//CEGA Javascript
function newWindow(page){
	var oneTimeWinName = "oneTimePop"
	var popcookies = document.cookie
	if (popcookies.indexOf(oneTimeWinName) == -1){ // cookie not found 
    window.open(page, oneTimeWinName, 'width=300, height=300, toolbar=No location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no, resizable=yes top=250, left=550, screenX=550, screenY=250')
    document.cookie=oneTimeWinName+"=used"
    }
	
}

function PageLink(url){
		mywindow=window.open (url,'PageLink')
		mywindow.focus()
		}
		
function homePage(msgStr){
		window.resizeTo (window.screen.width, window.screen.height-27)//Maximise window
		window.moveTo ( 0, 0 ); // Moving the window in the upper-left corner
		window.status=msgStr;
		}

function popUp(url,name,width,height,menubar,scrollbars,resizable,location,status,directories,toolbar,top,left,screenX,screenY){
	window.open(url,name,"width=" + width + ",height=" + height + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",location=" + location + ",status=" + status + ",directories=" + directories + ",toolbar=" + toolbar + ",top=" + top + ",left=" + left + ",screenX=" + screenX + ",screenY=" + screenY + "")
}

function printPage() {
  if (window.print)
    window.print()
  else
    alert("Sorry, your browser doesn't support this feature.");
}

function closePage(){
	window.close();
		}
		
		
function EC_statusMsg(message){
	status=message;
	document.EC_returnValue=true;
	}
	
function clearMsg(){
	window.status='';
	}

function findObj(frm, nme){
var obj;
	for(i=0; i<frm.elements.length; i++){
		if (frm.elements[i].name=nme){
			obj=frm.elements[i];
			}
		}
		return obj;
	}
	
function gotoURL(x){
var frm=this.document.forms[0];
var obj=findObj(frm,x);
var url=obj.options[obj.selectedIndex].value;
	
	if (url!="" && url == "ausma.htm"){
			popUp(url,'temp','300','200','0','1',1,0,0,0,0,100,100,100,100);
			}
	else if (url!="" && url == "Products/Fitorodents.htm" || url == "Products/Fitoekols.htm" ){
			popUp(url,'temp','400','400','0','0',0,0,0,0,0,100,100,100,100);
			}
	else if (url!="" && url == "Products/Chlorophyll.htm" ){
			popUp(url,'temp','400','135','0','0',0,0,0,0,0,100,100,100,100);
			}
	else if (url!="" &&  url == "Products/Essential Oils.htm"){
			popUp(url,'temp','400','100','0','0',0,0,0,0,0,100,100,100,100);
			}
	else if (url!="" && url == "Products/Silbiol.htm" || url == "Products/Polyprenols.htm" || url == "Products/HOFI.htm" ){
			popUp(url,'temp','400','500','0','1',0,0,0,0,0,100,100,100,100);
			}
	else {
		return true
		}				
}// end of function
	
