function confirm_delete(formname){input_box=confirm("Are you sure you want to delete?");if(input_box==true){eval("document."+formname+".entry.name='delete_entry';");eval("document.forms['"+formname+"'].submit();");}else{return false;}}
function confirm_cart(formname){input_box=confirm("Are you sure you want to remove this item from the cart?\n\r\n\rClick OK to remove it or Cancel to keep it.");if(input_box==true){eval("document.forms['"+formname+"'].submit();");}else{return false;}}
function confirm_forward(msg,URL){input_box=confirm(msg);if(input_box==true){eval("window.location='"+URL+"';");}else{return;}}
function pop_guarantee(){eval("guarantee=window.open('http://myevent.com/popup.php?componentID=display_content&cont=ironclad_guarantee', 'guarantee', 'toolbar=1,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=450,height=550,left=200,top=50');");}function pop_guaranteeWebsiteworks(){eval("guarantee=window.open('http://websiteworks.com/popup.php?componentID=display_content&cont=ironclad_guarantee', 'guarantee', 'toolbar=1,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=450,height=550,left=200,top=50');");}
function pop_promo(){eval("promo=window.open('http://myevent.com/popup.php?componentID=display_content&cont=promo_july', 'promo', 'toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=710,height=620,left=200,top=0');");}
function pop_promo_wsw(){eval("promo=window.open('http://websiteworks.com/popup.php?componentID=display_content&cont=promo_july', 'promo', 'toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=695,height=520,left=200,top=0');");}
function pop_promo_mw(){eval("promo=window.open('http://makeswebsites.com/popup.php?componentID=display_content&cont=promo_july', 'promo', 'toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=695,height=520,left=200,top=0');");}
function pop_package(){eval("package=window.open('http://myevent.com/popup.php?componentID=display_content&cont=fundraising_package', 'package', 'toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=710,height=620,left=200,top=0');");}

function pop_ticket(){eval("ticket=window.open('http://reunions.myevent.com/popup.php?componentID=display_content&cont=account_ticket', 'ticket', 'toolbar=1,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=450,height=550,left=200,top=50');");}


function popup(URL){eval("privacy_policy=window.open(URL, 'privacy_policy', 'toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=470,left=200,top=50');");privacy_policy.focus();}
function popup_article(URL, width, height){eval("article=window.open(URL,'article', 'toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+width+',height='+height+',left=20,top=50');");article.focus();}
function popup_bemail(URL){eval("edit_info=window.open('"+URL+"', 'imageDisplay', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=840,height=510,left=100,top=50')");edit_info.focus();}
function popfact(URL,w,h,x,y){if(!w)var w=550;if(!h)var h=550;if(!l)var l= 20;if(!t)var t=20;eval("facts=window.open('/popup.php?componentID=display_content&cont=hint_"+URL +"', 'factDisplay', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+w+",height="+h+",left="+l+",top="+t+"');");eval("facts.resizeTo(w,h);");eval("facts.moveTo(x, y);");eval("facts.focus();");}
function genericPop(content,w,h,l,t,s){if(!w)var w=550;if(!h)var h=550;if(!l)var l= 20;if(!t)var t=20;if(!s)var s=0;eval("miscContent=window.open('/popup.php?componentID=display_content&cont="+content+"', 'miscContent', 'toolbar=1,scrollbars="+s+",location=0,statusbar=0,menubar=0,resizable=1,width="+w+",height="+h+",left="+l+",top="+t+"');");}
function popURL(URL,w,h,l,t,s){if(!w)var w=550;if(!h)var h=550;if(!l)var l= 20;if(!t)var t=20;if(!s)var s=0;eval("miscContent=window.open('"+URL+"', 'miscContent', 'toolbar=1,scrollbars="+s+",location=0,statusbar=0,menubar=0,resizable=1,width="+w+",height="+h+",left="+l+",top="+t+"');");}
function show_hide(elem,lock){if(document.getElementById(elem+'_show_link')){varshowlink_el=document.getElementById(elem+'_show_link');}if(document.getElementById(elem+'_hide_link')){varhidelink_el=document.getElementById(elem+'_hide_link');}var el=document.getElementById(elem);if(lock==1 && el.style.display=='none')return;if(lock==2 && el.style.display!='none')return;if(el.style.display=='none'){el.style.display='block';if(document.getElementById(elem+'_hide_link'))hidelink_el.style.display='block';if(document.getElementById(elem+'_show_link'))showlink_el.style.display='none';}else{el.style.display='none';if(document.getElementById(elem+'_hide_link'))hidelink_el.style.display='none';if(document.getElementById(elem+'_show_link'))showlink_el.style.display='block';}}
function cookie_show_hide(elem){var showlink_el=elem+'_show_link';var hidelink_el=elem+'_hide_link';var el=elem;var hideelem=document.getElementById(elem);if(hideelem.style.display == 'block'){Cookies.create(el,'block');Cookies.create(hidelink_el,'block');Cookies.create(showlink_el,'none');}else{Cookies.create(el,'none');Cookies.create(hidelink_el,'none');Cookies.create(showlink_el,'block');}}
var Cookies={init: function(){var allCookies=document.cookie.split('; ');for(var i=0;i<allCookies.length;i++){var cookiePair=allCookies[i].split('=');this[cookiePair[0]]=cookiePair[1];}},
create: function (name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}else var expires="";document.cookie=name+"="+value+expires+"; path=/";this[name]=value;},
erase: function (name){this.create(name,'',-1);this[name]=undefined;},
retrieve: function (name){return this[name]}
};
Cookies.init();
function maketransparent(){if(navigator.appVersion.indexOf("MSIE 6.")==-1)return;for(var i=0; i<document.images.length; i++){var img=document.images[i];var imgName=img.src.toUpperCase();if(imgName.substring(imgName.length-3, imgName.length) == "PNG"){var meth="scale";if(img.className == "titleimg") meth= "none"; var imgID=(img.id) ? "id='"+img.id+"' " : "";var imgClass=(img.className) ? "class='"+img.className+"' " : "";var imgTitle=(img.title) ? "title='"+img.title+"' " : "title='"+img.alt+"' ";var imgStyle="display:inline-block;"+img.style.cssText ;if(img.align == "left") imgStyle="float:left;"+imgStyle;if(img.align == "right") imgStyle="float:right;"+imgStyle;if(img.parentElement.href)imgStyle="cursor:hand;"+imgStyle;var strNewHTML="<span "+imgID+imgClass+imgTitle+" style=\""+"width:"+img.width+"px; height:"+img.height+"px;"+imgStyle+";"+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"+ "(src=\'"+img.src+"\', sizingMethod='"+meth+"');\"></span>";img.outerHTML=strNewHTML;i=i-1}}}
function alternate(id){if(document.getElementById(id)){if(document.getElementById){var table=document.getElementById(id);var rows=table.getElementsByTagName("tr");for(i=0; i < rows.length; i++){doAlternate(rows[i], i);}}}}
function doAlternate(row, i){if(i % 2 == 0){row.className="listTableGrey";}else{row.className="listTableWhite";}}
function externalLinks(){if(!document.getElementsByTagName) return;var anchors=document.getElementsByTagName("a");for(var i=0; i<anchors.length; i++){var anchor=anchors[i];if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")anchor.target="_blank";if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "help_window"){anchor.target="help_window";}}}
function view_my_site(url){var viewMySite=open('http://www.'+url, 'viewMySite');if(viewMySite)viewMySite.focus();}
function CreateBookmarkLink(){var url="https://www.myevent.com/login.php";var title="Login to My Web Site";if(window.sidebar){window.sidebar.addPanel(title, url,"");}else if(window.external){window.external.AddFavorite( url, title); }else if(window.opera && window.print){ return true;}}
function openWin(URL){awindow=window.open(URL,"thewindow","width=850, height=750, scrollbars=yes, location=yes, directories=no, copyhistory=yes, status=yes, menubar=yes, resizable=yes,toolbar=yes");}
function right(e){if(navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))return false; else if(navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)){alert("Sorry, you do not have permission to right click.");return false;}return true;}
function navigate_ecom(cmp,subpage){ecomLink=document.getElementsByTagName("form")[1];ecomLink.action="?componentID="+cmp+"&page=7&subpage="+subpage;ecomLink.submit()}
function changeState(btn){var btnArray=new Array("optionOne_btn","optionTwo_btn","optionThree_btn");for(var i=0; i<btnArray.length; i++){thisBtn = btnArray[i];if(document.getElementById(thisBtn)){if(thisBtn!=btn){document.getElementById(thisBtn).className=thisBtn + "_closed";}else{document.getElementById(thisBtn).className=thisBtn + "_open";}}}}
function adjustForScreen(){var w=screen.width;if(w < 1030){document.getElementById('container_container').style.width = "1000px";document.getElementById('big_container').style.left = "-15px";if(document.getElementById('starting_at'))document.getElementById('starting_at').style.left = "875px";if(document.getElementById('free_trial_sticker'))document.getElementById('free_trial_sticker').style.left = "875px";}}
function displayTip(n){return "<div class='display_hint'>" + HINTS_ITEMS[n] + "</div>"}
function showStep(step){var stepArray=new Array("sellFirst","sellStepOne","sellStepTwo","sellStepThree","homeStepOne","homeStepTwo","homeStepThree","stepFirst","stepHome","step1","step2","step3","step4","step5","step7");var thisStep=null;for(var i=0; i<stepArray.length; i++){thisStep = stepArray[i];if(thisStep!=step){if(document.getElementById(thisStep + "_btn"))document.getElementById(thisStep + "_btn").style.visibility="visible";if(document.getElementById(thisStep))document.getElementById(thisStep).style.display="none";}else{if(document.getElementById(thisStep + "_btn"))document.getElementById(thisStep + "_btn").style.visibility="hidden";if(document.getElementById(thisStep))document.getElementById(thisStep).style.display="block";}}}
function confirm_generic(msg, formname){var input_box=confirm(msg);if(input_box==true){document.forms[formname].submit(); return true}else{return false}}
function submitform(frm){eval('document.all.'+frm+'.submit()')}
function passAff(){if(!document.getElementsByTagName) return;if (!location.search) return;var anchors = document.getElementsByTagName("a");for (var i=0; i<anchors.length; i++){var anchor = anchors[i];var thehref = anchor.getAttribute("href");if(thehref=='http://www.websiteworks.com/' || thehref=='http://websiteworks.com/' || thehref=='http://www.websiteworks.com' || thehref=='http://websiteworks.com')anchor.href = 'http://www.websiteworks.com' + location.search;}}
function showMenuItem(){if(typeof currentPage == "undefined") return;if(currentPage.substring(0,22)=="let_us_build_your_site"){document.getElementById('optionOne_btn').className = "optionOne_btn_closed";document.getElementById('optionThree_btn').className = "optionThree_btn_open";}if(currentPage.substring(0,13)=="shopping_cart"){document.getElementById('optionOne_btn').className = "optionOne_btn_closed";document.getElementById('optionTwo_btn').className = "optionTwo_btn_open";}if(document.getElementById(currentPage)){document.getElementById(currentPage).className = "currentPage";}}
function login_focus(){if(document.getElementById('username_field'))document.getElementById('username_field').focus()}
function openURL(goURL){top.location.href = goURL}
function changeButton(eventType){
	var eventTypeArray= new Array("eventSpecificBirth","eventSpecificSportingEvent","eventSpecificFund","eventSpecificCorp","eventSpecificAny","eventSpecificAnyCause","eventSpecificCharities","eventSpecificNonProfit","eventSpecificSchool","eventSpecificSports");
	var thisEvent=null;
	for(var i=0; i<eventTypeArray.length; i++){
		thisEvent = eventTypeArray[i];
		if(thisEvent!=eventType){
			if(document.getElementById(thisEvent))
				document.getElementById(thisEvent).className = thisEvent + "_closed";
		}else{
			if(document.getElementById(thisEvent))
				document.getElementById(thisEvent).className = thisEvent + "_open";
		}
	}
}

function rotateCont(){
	if(eventPreSelected){
		changeButton(eventPreSelected);
		return;
	}
	
	if(eventPressed){
		return;
	}

	if(document.cookie){
		var eventPressedCookie = null;
		var eventPressedCookie = Cookies.retrieve('eventPressed');
		if(eventPressedCookie){
			changeButton(eventPressedCookie);
			return;	
		}
	}

	changeButton(scrollingEvents[currentEvent]);
	if(first_loop == null){
		getcontent(scrollingEvents[currentEvent] ,"eventSpecific",scrollingEvents[currentEvent]);
	}
	if (currentEvent==scrollingEvents.length - 1){
		currentEvent=0
	}else{
		first_loop = null;
		currentEvent++
	}
	setTimeout("rotateCont()",4000)
}

function adjustCPForScreen(){
var s=screen.width;
var w=windowSize();

if(w < 1250){
		var x=document.getElementsByTagName('body')[0];
		x.className = 'resized_body';
		var newwidth = "1016px";
		if(document.getElementById('big_container')){
			document.getElementById('big_container').style.width = newwidth;
			document.getElementById('big_container').style.left = "-13px";
			document.getElementById('banner_cell_cpanel').style.backgroundPosition= "-14px 20px";
			document.getElementById('content_bg_footer').style.backgroundPosition= "-21px 0px"
			document.getElementById('big_container').style.overflow="hidden";
		}
		if(document.getElementById('cpanel_pre_container')){
			document.getElementById('cpanel_pre_container').style.width = newwidth;
			document.getElementById('cpanel_pre_container').style.overflow="hidden";
		}
		if(document.getElementById('right_column'))
			document.getElementById('right_column').style.display = "none";
	}else{
		if(w > 1200){
			if(document.getElementById('big_container'))
				document.getElementById('big_container').style.left = "0px";
			if(document.getElementById('right_column'))
				document.getElementById('right_column').style.display = "block";		
		}
	}
	if (typeof(hide_right_column) != "undefined" && hide_right_column) { 
		document.getElementById('right_column').style.display = "none";
		
	}
}

function windowSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
   } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
   } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
   }
 return myWidth;
 
}

function prepguestfields(the_array_name, family_fields){ 

	if(the_array_name == "Individual"){
		document.getElementById("information").innerHTML = ''; 
	 	document.getElementById("information2").innerHTML = 
		'<input type="text" tabindex="1" name="first_1"  value="' + first_names[1] + '" size="25">';
	 	document.getElementById("information3").innerHTML = 
		'<input type="text" tabindex="2" name="last_1" value="' + last_names[1] + '" size="25"><input type="hidden" name="family_fields" value="1">'; 
	}

	if(the_array_name == "Couple"){
		document.getElementById("information").innerHTML = ''; 
		document.getElementById("information2").innerHTML = 
		'<span class="fineprint">1)</span> <input type="text" tabindex="1" name="first_1"  value="' + first_names[1] + '" size="25"><br><span class="fineprint">2)</span> <input type="text" name="first_2" tabindex="3" value="' + first_names[2] + '" size="25"><input type="hidden" name="family_fields" value="2">';
		document.getElementById("information3").innerHTML = 
		'<input type="text" name="last_1"  tabindex="2"  value="' + last_names[1] + '" size="25"><br><input type="text" name="last_2"  tabindex="4" value="' + last_names[2] + '" size="25">'; 
	}

	if(the_array_name == "Family"){

		if(!family_fields){
			family_fields=1;
		}

		if(family_fields){
			var display_select;
			for(i=1; i<9; i++){

			if(i == family_fields){
				display_select += '<option selected>' + i + '</option>n';
			     }else{
				display_select += '<option>' + i + '</option>n';
				}
			}
		}

		document.getElementById("information").innerHTML = 
		'<select name="family_fields" id ="family_fields" onChange=prepfamilyfields(document.getElementById("family_fields").options[selectedIndex].text,document.getElementById("family_fields").options[selectedIndex].text);>'+

		display_select +

		'</select>'; 

		document.getElementById("information2").innerHTML = 
		'<input type="text" name="first_1" tabindex="1" size="25">'; 

		document.getElementById("information3").innerHTML = 
		'<input type="text" name="last_1" tabindex="2" size="25">';
	}
}


first_names = new Object();
first_names["1"] = "";
first_names["2"] = "";
first_names["3"] = "";
first_names["4"] = "";
first_names["5"] = "";
first_names["6"] = "";
first_names["7"] = "";
first_names["8"] = "";

last_names = new Object();
last_names["1"] = "";
last_names["2"] = "";
last_names["3"] = "";
last_names["4"] = "";
last_names["5"] = "";
last_names["6"] = "";
last_names["7"] = "";
last_names["8"] = "";


function prepfamilyfields(the_array_name){

	var famfields_first="";
	var famfields_last="";
	var i=0;
	var j=i+1;
	var ti=1;

	while(i< the_array_name){
		famfields_first +='<span class="fineprint">' + j + ') <input type="text" tabindex="'+ti+'" name="first_' + j +'" value="' + first_names[j] + '" size="25"><br>'; 

		ti=ti+1;

		famfields_last +='<input type="text" tabindex="'+ti+'" name="last_'+j+'" value="' + last_names[j] + '" size="25"><br>'; 

		ti=ti+1;
		i=i+1;
		j=j+1;
	}

	document.getElementById("information2").innerHTML = famfields_first; 
	document.getElementById("information3").innerHTML = famfields_last; 
}



function popitup(url) {
	newwindow=window.open(url,'name','height=550,width=450');
	if (window.focus) {newwindow.focus()}
	return false;
}
function initopt(){
	opt.init();
}
