// Application: SQPS_v02_02_03 - portal implementation
function openWindow(url){
	var strFeatures = "resizable,width=500,height=570,location=off,menubar=off,scrollbars,toolbar=off,";
	if (document.all){
		strFeatures += "left=100,top=50";
	}
	else{
		strFeatures += "screenX=100,screenY=50";
	}
	dwin=window.open(url,"help",strFeatures);
	dwin.focus();
}
function openFeedback(url){
	var strFeatures = "resizable,width=500,height=570,location=off,menubar=off,scrollbars,toolbar=off,";
	if (document.all){
		strFeatures += "left=100,top=50";
	}
	else{
		strFeatures += "screenX=100,screenY=50";
	}
	dwin=window.open(url,"Feedback",strFeatures);
	dwin.focus();
}
function openTracking(url,sWebsiteParam,sWebsiteValue, sTitleParam,sTitleValue,sLanguageParam,sLanguagevalue,sParam1, sParam1Value,sParam2, sParam2value){
	dcsMultiTrack(sWebsiteParam,sWebsiteValue,sLanguageParam,sLanguagevalue,sParam1, sParam1Value,sParam2, sParam2value);
	var strFeatures = "resizable,width=700,height=480,location,menubar,scrollbars,toolbar,";
	if (document.all){
		strFeatures += "left=100,top=50";
	}
	else{
		strFeatures += "screenX=100,screenY=50";
	}
	dwin=window.open(url,"tracking",strFeatures);
	dwin.focus();
}
function openPrint(url){
	var strFeatures = "resizable,width=600,height=570,location=off,menubar,scrollbars,toolbar=off,";
	if (document.all){
		strFeatures += "left=100,top=50";
	}
	else{
		strFeatures += "screenX=100,screenY=50";
	}
	dwin=window.open(url,"print",strFeatures);
	dwin.focus();
}
function openCertificate(form){
	var strFeatures = "resizable,width=600,height=570,location=off,menubar,scrollbars,toolbar=off,";
	alert ('data=' + form.href);
	if (document.all){
		strFeatures += "left=100,top=50";
	}
	else{
		strFeatures += "screenX=100,screenY=50";
	}
	dwin=window.open("","RoHS",strFeatures);
	dwin.focus();
}
function verifyForm( form, max_number, one_item_text, max_item_text ){
	form.action = "viewcertificate.asp"
	var iChecked = 0 ;
	if (!form.ITEMLIST.length){
		if (!form.ITEMLIST.checked){
			alert( one_item_text ) ;
			return false;
		}
		else{
			form.submit();
		}
	}
	else{
		for( var i = 0 ; i < form.ITEMLIST.length ; i++ ){
			if( form.ITEMLIST[i].checked )
			iChecked++ ;
			if( iChecked > max_number ){
				alert( max_item_text + " " + max_number ) ;
				return false ;
			}
		}
		if( iChecked < 1 ){
			alert( one_item_text ) ;
			return false ;
		}
		var strFeatures = "resizable,width=780,height=570,location=off,menubar,scrollbars,toolbar=off,";
		if (document.all){
			strFeatures += "left=100,top=50";
		}
		else{
			strFeatures += "screenX=100,screenY=50";
		}
		dwin=window.open("","RoHS",strFeatures);
		dwin.focus();
		form.submit();
	}
}
function CheckData(form,error_msg, minchar){
	var strAlertMessage = error_msg;
	i=0;
	var string = form.SRCH.value;
	string = string.replace(/\*/g,'');
	if (string.length < minchar){
		alert(strAlertMessage);
		return false;
	}
	else{
		return true;
	}
}
var defaultfontsize = 0
function getFontSize(){
	if (document.defaultView && document.defaultView.getComputedStyle){
		return parseInt(document.defaultView.getComputedStyle(document.body,'').getPropertyValue("font-size"))
	}
	else if (document.all && document.body.currentStyle){
		return parseInt(document.body.currentStyle.fontSize)
	}
}
function check(){
	var currentsize = getFontSize()
	if (currentsize != defaultfontsize){
		window.document.location.reload(false);
	}
	defaultfontsize = currentsize
}
function checkfontsize(){
	var theInterval = 500
	if ((document.defaultView && document.defaultView.getComputedStyle) || (document.all && document.body.currentStyle)){
		defaultfontsize = getFontSize()
		if (document.location.hostname != 'prodselector01'){
			setInterval("check()",theInterval)
		}
	}
}

/*
function verifyFormForReach( form, max_number, one_item_text, max_item_text ){
	form.action = "viewcertificatereach.asp"
	var iChecked = 0 ;
	if (!form.ITEMLIST.length){
		if (!form.ITEMLIST.checked){
			alert( one_item_text ) ;
			return false;
		}
		else{
			form.submit();
		}
	}
	else{
		for( var i = 0 ; i < form.ITEMLIST.length ; i++ ){
			if( form.ITEMLIST[i].checked )
			iChecked++ ;
			if( iChecked > max_number ){
				alert( max_item_text + " " + max_number ) ;
				return false ;
			}
		}
		if( iChecked < 1 ){
			alert( one_item_text ) ;
			return false ;
		}
		var strFeatures = "resizable,width=780,height=570,location=off,menubar,scrollbars,toolbar=off,";
		if (document.all){
			strFeatures += "left=100,top=50";
		}
		else{
			strFeatures += "screenX=100,screenY=50";
		}
		dwin=window.open("","RoHS",strFeatures);
		dwin.focus();
		form.submit();
	}
}
*/

function verifyFormForReach( form, max_number, one_item_text, max_item_text ){
	form.action = "viewcertificatereach.asp"
	var iChecked = 0 ;
	if (!form.ITEMLISTREACH.length){
		if (!form.ITEMLISTREACH.checked){
			alert( one_item_text ) ;
			return false;
		}
		else{
			form.submit();
		}
	}
	else{
		for( var i = 0 ; i < form.ITEMLISTREACH.length ; i++ ){
			if( form.ITEMLISTREACH[i].checked )
			iChecked++ ;
			if( iChecked > max_number ){
				alert( max_item_text + " " + max_number ) ;
				return false ;
			}
		}
		if( iChecked < 1 ){
			alert( one_item_text ) ;
			return false ;
		}
		var strFeatures = "resizable,width=780,height=570,location=off,menubar,scrollbars,toolbar=off,";
		if (document.all){
			strFeatures += "left=100,top=50";
		}
		else{
			strFeatures += "screenX=100,screenY=50";
		}
		dwin=window.open("","RoHS",strFeatures);
		dwin.focus();
		form.submit();
	}
}


