/*------------------ global js (Front End) ----------------------------*/

/*--------------- Change style css ----------------------*/
function celOver(obj) {
  var s = obj.className;
  s = s.replace(/-over/g, "");
  obj.className = s+"-over";
}

function celOut(obj) {
  var s = obj.className;
  s = s.replace(/-over/g, "");
  obj.className = s;
}


/*------------- Search field ----------------*/
function searchinfo() {
  var errors = '';
  var form = document.SearchFrm
  if (form.searchfield.value == "Search" || form.searchfield.value == "") {
    errors = "True";
  }
  if (errors) {
    //alert('The following error(s) occurred:\n'+errors);
  }
  document.MM_returnValue = (errors == '');
}

function searchfocus(val) {
  if (val.value == "Search") {
    val.value = "";
  }
}

function searchblur(val) {
  if (val.value == "") {
    val.value = "Search";
  }
}


/*-------gallery system (item)----------*/
function popup(idimg,width,height) { 
  xp = (screen.width-width)/2;
  if (xp <= 0) {
    xp = 0;
  }
  yp = 0;

  fen = window.open(idimg,'','toolbar=0,location=0,directories=0,status=0,scrollbars=0,resizable=0,copyhistory=0,menuBar=0,top='+yp+',left='+xp+',width=' + width + ',height=' + height);
  fen.focus(); 
}

/*------- Gallery system (itempopup)----------*/
function checksize() {
 if (document.images[0].complete) {
  window.resizeTo(document.images[0].width+12,document.images[0].height+30);
  window.focus();
 }
}


/*------- Function to alternate the colours on rows of a table ----------*/
function alternate(id){
 if(document.getElementsByTagName){  
   var table = document.getElementById(id);  
   var rows = table.getElementsByTagName("tr");  
   for(i = 0; i < rows.length; i++){          
 //manipulate rows
 
     if (! hasClass(rows[i])) {
        
		 if(i % 2 == 0){
		   rows[i].className = "odd";
		 }else{
		   rows[i].className = "even";
		 }

     }
	 
   }
 }
}


        function change_parent_url(url)
        {
	    document.location=url;
        }		

/*------------------end global js----------------------------*/


