//<!--

DrawPkgBox();

function DrawPkgBox()
{
	DoDrawing('<!-- Widget Prefix -->'+
'<style type="text/css">'+
'.ts_pds_layout1_entry1 {font-family: Arial, Helvetica, Sans-Serif; font-size: 12px;}'+
'.ts_gpds_deal_source {font-family: Arial, Helvetica, Sans-Serif; font-size: 10px; font-weight: normal; color: #666;}'+
'.ts_gpds_post_date {font-family: Arial, Helvetica, Sans-Serif; font-size: 10px; font-weight: normal; color: #666;}'+
'</style><style type="text/css">'+
'#widgetWrapper { padding: 0px; width: 280px; }'+
'.ts_pds_layout1_entry1 a {font-family: Arial, Helvetica, Sans-Serif; font-size: 12px; font-weight: normal;}'+
'.ts_gpds_deal_source {font-family: Arial, Helvetica, Sans-Serif; font-size: 10px; font-weight: normal; color: #666;}'+
'.ts_gpds_post_date {font-family: Arial, Helvetica, Sans-Serif; font-size: 10px; font-weight: normal; color: #666;}'+
'#gpds_16_holder {font-family: Arial, Helvetica, Sans-Serif;}'+
'#gpds_16_holder .ts_pds_layout1_entry1 {font-size: 12px; color: #000000; line-height: 14px; font-weight: normal;}'+
'table.ts_frontpage_widget {height: auto;}'+
'#gpds_16_holder a {text-decoration: none;}'+
'#gpds_16_holder .ts_gpds_style2_body { color: #666; font-size: 10px; line-height: 10px; font-weight: normal;}'+
'#gpds_16_holder .ts_pds_layout1_moreInfo1 {font-size:  10px; color: #5E9FB3;}'+
' a.ts_pds_viewInfo{color:#16599a; font-weight: bold;}'+
'.blogThumbnailImg {width:76px; height:56px; border:1px solid #000000; margin: 4px;}'+
'</style>'+
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><div id="ts_gpds_layout_16" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="http://mycompany.com/mynamespace"><table align="center" width="100%" cellpadding="0" cellspacing="0" border="0" id="gpds_16_holder"><tr><td valign="top" align="center" class="ts_pds_layout1_entry1"><table border="0" width="100%" cellpadding="0" cellspacing="0" id="pkgContainer" class="ts_pds_entry_table"><tr><td align="center"><a href="http://topdeals.nationalgeographic.travelscream.com/a187565693.htm" target="_blank"><img width="80" height="60" border="0" src="http://images.travelscream.com/NewTemplate/12017/00024899.jpg" class="blogThumbnailImg" /></a><img src="http://images.travelscream.com/spacer.gif" height="1" /></td><td align="left" valign="middle" style="padding-left: 6px;"><a class="ts_pds_layout1_entry1" href="http://topdeals.nationalgeographic.travelscream.com/a187565693.htm" target="_blank">Orange County, CA: All Marriott Brand Hotels &amp; Resorts On Sale! From $89</a><br /><a class="ts_pds_viewInfo" href="http://topdeals.nationalgeographic.travelscream.com/a187565693.htm" target="_blank">Click Here for Details</a></td></tr><tr><td align="center"><a href="http://topdeals.nationalgeographic.travelscream.com/a188255602.htm" target="_blank"><img width="80" height="60" border="0" src="http://images.travelscream.com/NewTemplate/11741/00025093.jpg" class="blogThumbnailImg" /></a><img src="http://images.travelscream.com/spacer.gif" height="1" /></td><td align="left" valign="middle" style="padding-left: 6px;"><a class="ts_pds_layout1_entry1" href="http://topdeals.nationalgeographic.travelscream.com/a188255602.htm" target="_blank">Breckenridge: 50% Off 2 Studio Condo Nights + 2 Lift Tickets - $262</a><br /><a class="ts_pds_viewInfo" href="http://topdeals.nationalgeographic.travelscream.com/a188255602.htm" target="_blank">Click Here for Details</a></td></tr><tr><td align="center"><a href="http://topdeals.nationalgeographic.travelscream.com/a187539378.htm" target="_blank"><img width="80" height="60" border="0" src="http://images.travelscream.com/NewTemplate/12017/00024932.jpg" class="blogThumbnailImg" /></a><img src="http://images.travelscream.com/spacer.gif" height="1" /></td><td align="left" valign="middle" style="padding-left: 6px;"><a class="ts_pds_layout1_entry1" href="http://topdeals.nationalgeographic.travelscream.com/a187539378.htm" target="_blank">Houston: Discounted Luxury &amp; Budget Stays at All Marriott Brand Hotels - From $89</a><br /><a class="ts_pds_viewInfo" href="http://topdeals.nationalgeographic.travelscream.com/a187539378.htm" target="_blank">Click Here for Details</a></td></tr></table></td><td><img src="http://images.travelscream.com/spacer.gif" width="1" /></td></tr></table></div>'+
'');
}

function DoDrawing(inHTML)
{
	document.write(inHTML);
	
	if (document.getElementById("doPaging")){
		// load up the first div into the "main" div
			var newDiv = document.createElement("newDiv");
			if (document.getElementById("divNum_0")){ 
				newDiv.innerHTML = document.getElementById("divNum_0").innerHTML;
			}
			else if (document.getElementById("widgetID")){
				var wID = document.getElementById("widgetID").value;
				newDiv.innerHTML = document.getElementById(wID+"_divNum_0").innerHTML;
			}
			var cont = document.getElementById("mainDiv");
			cont.innerHTML = "";
			cont.appendChild(newDiv);
	}
}

function prevPage(){
	var totalItems = document.getElementById('totalPkg').value;
	var numPerPage = document.getElementById('numPerPage').value;

	if (parseInt(document.getElementById('curPage').value) - 1 < 1){
		document.getElementById('curPage').value = (totalItems/numPerPage);
	}
	else{
		document.getElementById('curPage').value = parseInt(document.getElementById('curPage').value) - 1;
	}

	goToPage();
}

function nextPage(){
	var totalItems = document.getElementById('totalPkg').value;
	var numPerPage = document.getElementById('numPerPage').value;

	if (parseInt(document.getElementById('curPage').value) + 1 > (totalItems / numPerPage)){
		document.getElementById('curPage').value = '1';
	}
	else{
		document.getElementById('curPage').value = parseInt(document.getElementById('curPage').value) + 1;
	}
	goToPage();
}


function numPage(pageNum){
		document.getElementById('curPage').value = pageNum;

	goToPage();
}

function goToPage() {
	var totalItems = document.getElementById('totalPkg').value;
	var numPerPage = document.getElementById('numPerPage').value;
	var currentPage = document.getElementById('curPage').value;

	for (i = 0; i <= (totalItems / numPerPage) - 1; i++){
		var divName = 'divNum_' + i;
		if (i == currentPage-1){
			if (document.getElementById("newDiv")){
				document.removeNode("newDiv");
			}
			var newDiv = document.createElement("newDiv");
			newDiv.innerHTML = document.getElementById(divName).innerHTML;
			var cont = document.getElementById("mainDiv");
			cont.innerHTML = "";
			cont.appendChild(newDiv);
		}
	}
}



/* Functions for multiple widgets on the same page */

function prevPageMulti(inDivName){
	var totalItems = document.getElementById('totalPkg').value;
	var numPerPage = document.getElementById('numPerPage').value;

	if (parseInt(document.getElementById('curPage').value) - 1 < 1){
		document.getElementById('curPage').value = (totalItems/numPerPage);
	}
	else{
		document.getElementById('curPage').value = parseInt(document.getElementById('curPage').value) - 1;
	}

	goToPageMulti(inDivName);
}

function nextPageMulti(inDivName){
	var totalItems = document.getElementById('totalPkg').value;
	var numPerPage = document.getElementById('numPerPage').value;

	if (parseInt(document.getElementById('curPage').value) + 1 > (totalItems / numPerPage)){
		document.getElementById('curPage').value = '1';
	}
	else{
		document.getElementById('curPage').value = parseInt(document.getElementById('curPage').value) + 1;
	}
	goToPageMulti(inDivName);
}


function numPageMulti(pageNum, inDivName){
		document.getElementById('curPage').value = pageNum;

	goToPageMulti(inDivName);
}

function goToPageMulti(inDivName) {
	var totalItems = document.getElementById('totalPkg').value;
	var numPerPage = document.getElementById('numPerPage').value;
	var currentPage = document.getElementById('curPage').value;

	for (i = 0; i <= (totalItems / numPerPage) - 1; i++){
		var divName = inDivName + '_divNum_' + i;
		if (i == currentPage-1){
			if (document.getElementById("newDiv")){
				document.removeNode("newDiv");
			}
			var newDiv = document.createElement("newDiv");
			newDiv.innerHTML = document.getElementById(divName).innerHTML;
			var cont = document.getElementById("mainDiv");
			cont.innerHTML = "";
			cont.appendChild(newDiv);
		}
	}
}

//-->