

function open_popuptheme(url,h,w,winname){
		open_window(url,'winname',0,0,0,1,1,h,w,0);		
		
		
		
}
function open_window(url,wname,dir,status,menu,scroll,resize,width,height,top) {
	var mywindow = window.open(url,wname,'directories='+dir+',status='+status+',menubar='+menu+',scrollbars='+scroll+',resizable='+resize+',width='+width+',height='+ height+',top='+top);
	if (!mywindow.opener)
			{mywindow.opener =self;mywindow.tempopener =self;}
}
	


function open_calendar_window(fieldname,formname) {
	var dateval
	dateval =  eval('document.'+formname+'.'+fieldname+'.value')
	mywin = window.open('/DovetailWMS/library/utils/Calendar.asp?FieldName=' + fieldname + '&FormName=' + formname+'&SelDate=' + dateval ,'Calendar',		'directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=157,height=175,top=100');
}


function updateParent(url,alturl) {		
var mywin;



	if(url.indexOf('/secure/')>-1 || url.indexOf('/shoppingcart.asp')>-1 ) {
		url='/shoppingcart.asp'
	}		


	if(window.opener!=null && !window.opener.closed){	
			window.opener.location=url;		
			window.opener.focus();		


	}
	else{	
			mywin = window.open(alturl);
			mywin.focus();									
	}

	window.close();	
}


function ini() {		

	if (document.layers)
		for(var layercount=0;layercount<document.layers.length;layercount++)
			for(var formcount=0;formcount<document.layers[layercount].document.forms.length;formcount++)
				if (document.layers[layercount].document.forms[formcount].name && document.layers[layercount].document.forms[formcount].name!='') 
				eval('document.' + document.layers[layercount].document.forms[formcount].name +' = document.layers[layercount].document.forms[formcount];');
	
}


