var contarr=new Array();



contarr=["Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Anguilla", "Antigua & Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia", "Botswana", "Bougainville", "Brazil", "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Rep.", "Chad", "Channel Islands", "Chile", "China", "Christmas Island", "Colombia", "Comoros", "Congo", "Cook Islands", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Faeroe Islands", "Falkland Islands", "Fiji", "Finland", "France", "French Guiana", "French Polynesia", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guatemala", "Guinea-Bissau", "Guyana", "Haiti", "Holy See", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Isle of Man", "Israel", "Italy", "Ivory Coast", "Jamaica", "Japan", "Johnston Island", "Jordan", "Kazakhstan", "Kenya", "Kirghizia", "Kiribati", "Kuwait", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macao", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Midway Islands", "Moldavia", "Monaco", "Mongolia", "Montenegro", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue Island", "Norfolk Island", "North Cyprus", "North Korea", "Norway", "Oman", "Pakistan", "Palestine", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn Islands", "Poland", "Portugal", "Qatar", "Queen Maud Land", "Reunion", "Romania", "Ross Dependency", "Russia", "Rwanda", "Sahara", "Saint Helena", "Saint Lucia", "Samoa", "San Marino", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "Somaliland", "South Africa", "South Korea", "Spain", "Spanish North Africa", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Timor", "Togo", "Tokelau Islands", "Tonga", "Trinidad & Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "Uruguay", "United States", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Wake Island", "Yemen", "Yugoslavia", "Zaire", "Zambia", "Zimbabwe"]



function congen(cnt) {

	if(cnt=="-----------------")

	{

		document.write('<option value="">'+cnt+'</option>');	

	}else{

		document.write('<option value="'+cnt+'">'+cnt+'</option>');

	}	

}

var statearr=new Array();

statearr=["Alabama","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","District of Columbia","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]

function stategen(cnt) {

	if(cnt=="-----------------")

	{

		document.write('<option value="">'+cnt+'</option>');	

	}else{

		document.write('<option value="'+cnt+'">'+cnt+'</option>');

	}	

}

function daygen(d,curr) {

	if(curr==d) {

		document.write('<option value="'+d+'" selected>'+d+'</option>');

	} 

	else {

		document.write('<option value="'+d+'">'+d+'</option>');

	}

}



//for Vpop

function jspopUp() {

	popupWin = window.open('subscribe.asp', 'Info', 'toolbars=0, scrollbars=1, location=0, statusbars=0, menubars=0, resizable=0, width=520, height=520, left = 200, top = 20');
	popupWin.focus();

}



function popSite(site) {

	window.open(site);

}



var m = new Array();

m[1]="January";

m[2]="February";

m[3]="March";

m[4]="April";

m[5]="May";

m[6]="June";

m[7]="July";

m[8]="August";

m[9]="September";

m[10]="October";

m[11]="November";

m[12]="December";



function monthgen(mon,cr) {

	if(cr==mon) {

		document.write('<option value="'+mon+'" selected>'+m[mon]+'</option>');

	}

	else {

		document.write('<option value="'+mon+'">'+m[mon]+'</option>');

	}

}



function goback()

{

  window.history.go(-1);

}



function gohome()

{

  window.location.replace("/subscription/");

}



function goview()

{

  window.location.replace("/subscriptions/admin/view_tbl.php?tbl=ulist");

}



function gouarea()

{

  window.location.replace("/subscription/user_area.php");

}



function goumod()

{

  window.location.replace("/subscription/mod_user.php");

}



function gomansub()

{

  window.location.replace("/subscription/manage_sub.php");

}





//Functions to generate the select list and save selections

function moveOver(frm,fld) {

	var boxLength = eval("document."+frm+".choiceBox.length");

	var selectedItem = eval("document."+frm+"."+ fld +".selectedIndex");

	var selectedText = eval("document."+frm+"."+ fld +".options[selectedItem].text");

	var selectedValue = eval("document."+frm+"."+ fld +".options[selectedItem].value");

	var i;

	var isNew = true;

	if (boxLength != 0) {

		for (i = 0; i < boxLength; i++) {

			thisitem = eval("document."+frm+".choiceBox.options[i].text");

			if (thisitem == selectedText) {

				isNew = false;

				break;

			}

		}

	}

	if (isNew) {

		newoption = new Option(selectedText, selectedValue, false, false);

		document.modarticle.choiceBox.options[boxLength] = newoption;

	}

	var s2 = eval("document."+frm+"."+ fld +".selectedIndex");

	s2=-1;

	vendselect = saveMe(frm);

}





function removeMe(frm) {

	var boxLength = eval("document."+frm+".choiceBox.length");

	arrSelected = new Array();

	var count = 0;

	for (i = 0; i < boxLength; i++) {

		if (eval("document."+frm+".choiceBox.options[i].selected")) {

			arrSelected[count] = eval("document."+frm+".choiceBox.options[i].value");

		}

	count++;

	}

	var x;

	for (i = 0; i < boxLength; i++) {

		for (x = 0; x < arrSelected.length; x++) {

			if (eval("document."+frm+".choiceBox.options[i].value") == arrSelected[x]) {

				document.modarticle.choiceBox.options[i] = null;

			}

		}

		boxLength = eval("document."+frm+".choiceBox.length");

	}

	vendselect = saveMe(frm);

}





function saveMe(frm) {

	var strValues = "|";

	var boxLength = eval("document."+frm+".choiceBox.length");

	var count = 0;

	if (boxLength != 0) {

		for (i = 0; i < boxLength; i++) {

			strValues = strValues + eval("document."+frm+".choiceBox.options[i].value") + "|" ;

			count++;

		}

	}

	if (strValues.length == 0) {

		//alert("You have not made any selections");

	}

	else {

		//alert("Here are the values you've selected:\r\n" + strValues);

	}

	document.modarticle.reference.value = strValues;

	document.modarticle.chkact.value = "1";

	//alert(document.reseller_frm.vendor.value);

}



// set events/promotions form action



function setEPFormOpt() {

	wForm = document.srh_frm1;

	onList = wForm.stopt;

	offList = wForm.cat;

	if (offList.options[offList.selectedIndex].value == "" && onList.options[onList.selectedIndex].value != "") {

		document.getElementById('srchOpts').style.visibility = "visible";

	}

	else {

		document.getElementById('srchOpts').style.visibility = "hidden";

	}

}



////////Functions to generate the second select list and save selections

function moveOver2(frm,fld)

{

	var boxLength = eval("document."+frm+".choiceBox2.length");

	var selectedItem = eval("document."+frm+"."+ fld +".selectedIndex");

	var selectedText = eval("document."+frm+"."+ fld +".options[selectedItem].text");

	var selectedValue = eval("document."+frm+"."+ fld +".options[selectedItem].value");

	var i;

	var isNew = true;

	if (boxLength != 0) {

		for (i = 0; i < boxLength; i++) {

			thisitem = eval("document."+frm+".choiceBox2.options[i].text");

			if (thisitem == selectedText) {

				isNew = false;

				break;

			}

		}

	}

	if (isNew) {

		newoption = new Option(selectedText, selectedValue, false, false);

		document.modarticle.choiceBox2.options[boxLength] = newoption;

	}

	var s2 = eval("document."+frm+"."+ fld +".selectedIndex");

	s2=-1;

	vendselect2 = saveMe2(frm);

}





function removeMe2(frm) {

	var boxLength = eval("document."+frm+".choiceBox2.length");

	arrSelected = new Array();

	var count = 0;

	for (i = 0; i < boxLength; i++) {

		if (eval("document."+frm+".choiceBox2.options[i].selected")) {

			arrSelected[count] = eval("document."+frm+".choiceBox2.options[i].value");

		}

		count++;

	}

	var x;

	for (i = 0; i < boxLength; i++) {

		for (x = 0; x < arrSelected.length; x++) {

			if (eval("document."+frm+".choiceBox2.options[i].value") == arrSelected[x]) {

				document.modarticle.choiceBox2.options[i] = null;

			}

		}

		boxLength = eval("document."+frm+".choiceBox2.length");

	}

	vendselect2 = saveMe2(frm);

}





function saveMe2(frm) {

	var strValues = "|";

	var boxLength = eval("document."+frm+".choiceBox2.length");

	var count = 0;

	if (boxLength != 0) {

		for (i = 0; i < boxLength; i++) {

			strValues = strValues + eval("document."+frm+".choiceBox2.options[i].value") + "|" ;

			count++;

		}

	}

	if (strValues.length == 0) {

		//alert("You have not made any selections");

	}

	else {

		//alert("Here are the values you've selected:\r\n" + strValues);

	}

	document.modarticle.reference2.value = strValues;

	document.modarticle.chkact2.value = "1";

	//alert(document.reseller_frm.vendor.value);

}



function DoDelete(c,t){

	if (confirm("Are you sure you want to permanently delete this outlet / review / feature from the list?")) {

		window.location = "/manage/delrow.php?id=" + c + "&tbl=" + t;

	}

}

