function win_open_saf(w,h,url){
	window.open("saf.php?width="+w+"&height="+h+"&url="+url,"Cromar","height="+h+",width=500,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,titlebar=no");
}

function printPage() {
	window.print();  
}

function closeMe(){
	window.close();
}

function swapImgOnOff(obj){
	imgUrl=obj.src.split('/');
	imgName=imgUrl[imgUrl.length-1];
	imgNameSplit=imgName.split('_');
	imgState=imgNameSplit[0];
	if(imgState=='off'){
		newState='on';
	} else if(imgState=='on'){
		newState='off';
	} else {
		newState=imgState;
	}
	newImgName=newState+'_'+imgNameSplit[1];
	newImgUrl='';
	for(i=0;i<(imgUrl.length-1);i++){
		newImgUrl=newImgUrl+imgUrl[i];
		if(i!=imgUrl.length-1){
			newImgUrl=newImgUrl+'/';
		}
	}
	obj.src=newImgUrl+newImgName;
}

function goToPage(url){
	window.location.href=url;
}

function qjmTransition(selectedOption){
	if(selectedOption!=0){
		goToPage("pages.php?p_id="+selectedOption.value);
	}
}

function centerWin(window_obj,window_width,window_height){
	// By Nio_Fox //
	var xPos = (parseInt(screen.width/2)-parseInt(window_width/2));
	var yPos = (parseInt(screen.height/2)-parseInt(window_height/2)) ;
	window_obj.moveTo(xPos,yPos);
}

function popPrintPage(pageId){
	window.open("ptp.php?width=600&height=600&pageId="+pageId,"Cromar","height=600,width=600,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,titlebar=no");
}