<!--
		function cvPopup(maplink, windowname){
			if (! window.focus)return true;
				var href;
			if (typeof(maplink) == 'string')
   				href=maplink;
			else
   				href=maplink.href;
		window.open(href, windowname, 'screenX=100, left=100, screenY=50, top=50, width=250, height=150, dependent=yes, scrollbars=yes, resizable=yes');
		return false;
		}

function linkUR(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=650,height=650');");
}


function sbFT46860Submit (){
	var fURL = 'http://www.kqzyfj.com/interactive?'
	var $url1 = 'http://www.superbreak.com/home.cfm?'
	var $url2 = ''
	var $url3 = ''
	
	var el = document.superbreakFT468x60Form.elements.length;
	for (var n = 0; n<el; n++) {
		if (n==0) {
			$url1 += document.superbreakFT468x60Form.elements[n].name+'='+document.superbreakFT468x60Form.elements[n].value;
		} else if (document.superbreakFT468x60Form.elements[n].name == 'url') {
			$url1 = $url1;
		} else if (document.superbreakFT468x60Form.elements[n].name == 'aid') {
			$url2 += document.superbreakFT468x60Form.elements[n].name+'='+document.superbreakFT468x60Form.elements[n].value;
		} else if (document.superbreakFT468x60Form.elements[n].name == 'pid') {
			$url3 += '&'+document.superbreakFT468x60Form.elements[n].name+'='+document.superbreakFT468x60Form.elements[n].value;
		} else {
			$url1 += '&'+document.superbreakFT468x60Form.elements[n].name+'='+document.superbreakFT468x60Form.elements[n].value;
		}
	}

	fURL += $url2;
	fURL += $url3;
	fURL += '&URL='+escape($url1);

	window.open(fURL);
	return false;
}

//function to trim year to two digits using regex
function LZ(x) { return(x<0||x>9?"":"0")+x; }




//function to output the months select
function outputmonths(month)  {
	var cmonth = 0;  //set empty countvar
	//set literal month names array
	var monthNames = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
	document.write('<select name="StartMonth" style="font-size:10px;">');
	for(i = 01; i <= 12; i++)  {
		cmonth = i.toString();  //convert interger to string (needed for below as leading 0's need to be passed to cfm processing)
		if(cmonth.length < 2)  { cmonth = "0"+cmonth;  }
		document.write('<option value="'+cmonth+'"');
		if(i == month)  { document.write(' selected');  }
		document.write('>'+monthNames[i - 1]+'</option>');
	}
	document.write('</select>'+'&nbsp;');
}


//function to output the days select
function outputdays(month, tomorrow)  {
	var day = 0;  //set empty countkvar
	document.write('<select name="StartDay" style="font-size:10px;">');
	for(i = 01; i <= 31; i++)  {
		day = i.toString();  //convert interger to string (needed for below as leading 0's need to be passed to cfm processing)
		if(day.length < 2)  { day = "0" + i;  }
		document.write('<option value="'+day+'"');
		if(i == tomorrow)  { document.write(' selected');  }
		document.write('>'+day+'</option>');
	}
	document.write('</select>'+'&nbsp;');
}

//function to output the years select
function outputyears(today, crossyear)  {
	var from = 0;
	var to = 1;
	if(crossyear == 1)  { from = 1; to = 2; }
	var cyear = 0;  //set empty countvar
	document.write('<select name="StartYear" style="font-size:10px;">');
	for( i = from; i <= to; i++)  {
		var year = today.getFullYear() + i;  
		var smallyear = LZ((today.getFullYear() + i)%100);
		
		document.write('<option value="'+smallyear+'"');
		if(i == today.getFullYear())  {  document.write(' selected');  }
		document.write('>'+year+'</option>');
	}
	document.write('</select>');
}		


//function called to output all the date selections
function createselects()  {
	//get all the date vars needed
	var today = new Date();
	var tomorrow = today.getDate() + 1;
	//month cross-over check
	if(tomorrow == 32)  { 
		tomrrow = 1;  
		var month = today.getMonth() + 2;
	}  else  {
		var month = today.getMonth() + 1;  //use add 1 as JS counts from 0
	}
	//year cross-over check
	if(month == 13)  {
		month = 1;
		crossyear = 1;
	}  else  {
		crossyear = 0;
	}
	
	
	outputdays(month, tomorrow);
	outputmonths(month);
	outputyears(today, crossyear);

}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=700,height=730,left = 0,top = 0');");
}


/*-------------------------------------------*/

function change(id, newClass) {
	var identity = document.getElementById(id);
	identity.className=newClass;
}

function miHoverAction(id, newClass) {
		if (miSelected == id) {
			change(id, newClass);
		} 
}

function miHover(id, newClass) {
	miSelected = id;
	//alert(miSelected);
	setTimeout("miHoverAction('"+id+"', '"+newClass+"');", 500);
}

function miClear(id, newClass) {
	change(id, newClass);
	miSelected = '';
}

function printReport() {
	change('layout', 'disappear');
	change('pReport', 'appear print-report');
	print();
	change('pReport', 'disappear');
	change('layout', 'appear');
}

function checkForQuotesAndLength(what,limit) {
		if (limit != "") {
			if (what.value.length>=limit) {
					return false;
				}
		} 
		// A single quote ' = 34 A double quote " = 39
		if ((event.keyCode == 34) || (event.keyCode == 39)) {
			return false;
		}
		//alert(event.keyCode)
}

function Close_ImgDelWindow(type) {
	window.opener.document[type].src = "../images/spacer.gif";
	window.opener.document.mwForm['h'+type].value = '';
	window.close();
}

function imgDel(type) {
	document[type].src = "../images/spacer.gif";
	document.bwwForm['h'+type].value = '';
}

function Close_ImgWindow(type, path, id, img) {
	window.opener.document.mwForm.ID.value = id;
	window.opener.document[type].src = '../images/'+path+'/' + img;
	window.opener.document.mwForm['h'+type].value = img;
	window.close();
}

function PopupImgCenterWH(page, width, height) {
	  var idStr = "&ID="+document.mwForm.ID.value;
		var iPathStr = "&iPath="+document.mwForm.iPath.value;
	  var top=(screen.height-height)/2;
	  var left=(screen.width-width)/2;
	  window.open(page+idStr+iPathStr,"mwPWin","top="+top+",left="+left+",width="+width+",height="+height+","+"menubar=no,scrollbars=no,statusbar=no");
}

/*----------- Mailer Scripts -----------------------------*/

function Close_MailerImgDelWindow(pos) {
	window.opener.document['Img'+pos].src = "../images/mailer/1pxSpacer.gif";
	window.opener.document.mwForm['miImg'+pos].value = '';
	window.close();
}


function Close_MailerImg(pos, miID, img) {
	//window.opener.document.mwForm.pID.value = mmID;
	window.opener.document['Img'+pos].src = "../mailer_images/" + img;
	window.opener.document.mwForm['miImg'+pos].value = miID;
	window.close();
}

function PopupImgLibCenterWH(page, width, height) {
	  var pIDStr = "&pID="+document.mwForm.pID.value;
	  var top=(screen.height-height)/2;
	  var left=(screen.width-width)/2;
	  window.open(page+pIDStr,"mwPWin","top="+top+",left="+left+",width="+width+",height="+height+","+"menubar=no,scrollbars=yes,statusbar=no");
}

function PopupPageCenterWH(page, width, height) {
	  var top=(screen.height-height)/2;
	  var left=(screen.width-width)/2;
	  window.open(page,"mwPWin","top="+top+",left="+left+",width="+width+",height="+height+","+"menubar=no,scrollbars=yes,statusbar=no");
}

function confirm_deleteRVars(id, retID, rVars, tID, pre) {
	if (confirm('Are you sure you want to delete?')) {
		document.location.href = "delete.php?id="+id+"&return="+retID+"&rVars="+rVars+"&tID="+tID+"&pre="+pre;			
	} else {
		return false;
	}
}
/*----------- End Mailer Scripts -------------------------*/

function Close_Refresh()
{
  window.opener.location.reload();
  window.close();
}


function confirm_delete(id, retID, tID, pre) {
	if (confirm('Are you sure you want to delete?')) {
		document.location.href = "delete.php?id="+id+"&return="+retID+"&tID="+tID+"&pre="+pre;			
	} else {
		return false;
	}
}


function make_live(id, qVal, retID, tID, pre) {
	document.location.href = "make_live.php?id="+id+"&qVal="+qVal+"&return="+retID+"&tID="+tID+"&pre="+pre;
}



function IsPopupBlocker() {
	var oWin = window.open("","testpopupblocker","width=100,height=50,top=5000,left=5000");
	if (oWin==null || typeof(oWin)=="undefined") {
		return true;
	} else {
		oWin.close();
		return false;
	}
}


function PopupCenterWH(page, width, height) {
	  var top=(screen.height-height)/2;
	  var left=(screen.width-width)/2;
	  window.open(page,"mwPWin","top="+top+",left="+left+",width="+width+",height="+height+","+"menubar=no,scrollbars=no,statusbar=no");
}

function PopupCenterWHS(page, width, height) {
	  var top=(screen.height-height)/2;
	  var left=(screen.width-width)/2;
	  window.open(page,"mwPWin","top="+top+",left="+left+",width="+width+",height="+height+","+"menubar=no,scrollbars=yes,statusbar=no");
}

function PopupImgCenterWHS(page, width, height) {
	  var pIDStr = "&pID="+document.mwForm.pID.value;
	  var top=(screen.height-height)/2;
	  var left=(screen.width-width)/2;
	  window.open(page+pIDStr,"mwPWin","top="+top+",left="+left+",width="+width+",height="+height+","+"menubar=no,scrollbars=yes,statusbar=no");
}

