function Latest(a){
	image='image-'+a;
	block='latest-'+a;
	if (document.getElementById(block).style.display=="block"){
		document.getElementById(block).style.display="none"
		document.getElementById(image).src="/images/plus.gif"
	}
	else if (document.getElementById(block).style.display=="none"){
		document.getElementById(block).style.display="block"
		document.getElementById(image).src="/images/minus.gif"
	}
	else {
		document.getElementById(block).style.display="none"
		document.getElementById(image).src="/images/plus.gif"		
	}	
}

function Go_news_left(a,max){
	for (x=0; x<max; x++){
		if (document.getElementById('latest-image-'+a+'-'+x).style.display=='block'){
			if (x==0){
				document.getElementById('latest-image-'+a+'-'+(max-1)).style.display='block';
				document.getElementById('latest-current-'+a).innerHTML=max;
			}
			else {
				document.getElementById('latest-image-'+a+'-'+(x-1)).style.display='block';
				document.getElementById('latest-current-'+a).innerHTML=x;
			}
			document.getElementById('latest-image-'+a+'-'+x).style.display='none';
			break
		}
	}
}

function	 Go_news_right(a,max){
	for (x=0; x<max; x++){
		if (document.getElementById('latest-image-'+a+'-'+x).style.display=='block'){
			if (x==max-1){
				document.getElementById('latest-image-'+a+'-0').style.display='block';
				document.getElementById('latest-current-'+a).innerHTML=1;
			}
			else {
				document.getElementById('latest-image-'+a+'-'+(x+1)).style.display='block';
				document.getElementById('latest-current-'+a).innerHTML=x+2;
			}
			document.getElementById('latest-image-'+a+'-'+x).style.display='none';
			break
		}
	}
}


function	 Go_left(max){
	for (x=0; x<max; x++){
		if (document.getElementById('latest-image-'+x).style.display=='block'){
			if (x==0){
				document.getElementById('latest-image-'+(max-1)).style.display='block';
				document.getElementById('latest-current').innerHTML=max;
			}
			else {
				document.getElementById('latest-image-'+(x-1)).style.display='block';
				document.getElementById('latest-current').innerHTML=x;
			}
			document.getElementById('latest-image-'+x).style.display='none';
			break
		}
	}
}

function	 Go_right(max){
	for (x=0; x<max; x++){
		if (document.getElementById('latest-image-'+x).style.display=='block'){
			if (x==(max-1)){
				document.getElementById('latest-image-0').style.display='block';
				//alert("911")				
				document.getElementById('latest-image-'+x).style.display='none';
				document.getElementById('latest-current').innerHTML=1;
			}
			else {
				document.getElementById('latest-image-'+(x+1)).style.display='block';
				document.getElementById('latest-image-'+x).style.display='none';				
				document.getElementById('latest-current').innerHTML=x+2;
			}
			break
		}
	}
}

/*
function getAbsolutePos(el)
{
   var r = { x: el.offsetLeft, y: el.offsetTop };
   if (el.offsetParent)
   {
       var tmp = getAbsolutePos(el.offsetParent);
       r.x += tmp.x;
       r.y += tmp.y;
   }
   return r;
}


function show_menu(m){
	c=document.getElementById('menu'+m);
	a=document.getElementById('mnu'+m);
	b=document.getElementById('logotbl');
	pos = getAbsolutePos(b);
	c.style.display="block";
	a.style.display="block";
	a.style.left=pos.x;
	p=document.getElementById('poser'+m);
	posc = getAbsolutePos(p);
	c.style.left=posc.x;
	a.style.top=posc.y-10;
	c.style.width="50px";
	c.style.height="40px";
}

function hide_menu(m){
	a=document.getElementById('menu'+m);
	a.style.display="none";
	a=document.getElementById('mnu'+m);
	a.style.display="none";
}

function ShoworHide(b){
	if (document.getElementById('menu'+b).style.display=='block'){
		document.getElementById('menu'+b).style.display='none';
	}
	else{
		for (x=1; x<=10; x++){
			if (a=document.getElementById('menu'+x)){
				a.style.display='none';
			}
		}
		document.getElementById('menu'+b).style.display='block';
	}
}

function screenSize() {
      var w, h;
      w = (window.innerWidth ? window.innerWidth : (document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.offsetWidth));
      h = (window.innerHeight ? window.innerHeight : (document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.offsetHeight));
      return {w:w, h:h};
}

Array.prototype.shuffle = function( b )
{
 var i = this.length, j, t;
 while( i ) 
 {
  j = Math.floor( ( i-- ) * Math.random() );
  t = b && typeof this[i].shuffle!=='undefined' ? this[i].shuffle() : this[i];
  this[i] = this[j];
  this[j] = t;
 }

 return this;
};
*/
function deltextfromsubmit(inp){
	if (inp.title==inp.value)
		inp.value='';
}
function instexttosubmit(inp){
	if (inp.value=='')	
		inp.value=inp.title;
}
$(window).load(function(){
	//if (!jQuery("#forpress .active").length){
		jQuery(".forpress").mouseover(function(){
			jQuery(this).children("img").attr("src", "/images/arrow-active.gif")
			jQuery(this).children("a").css("text-decoration", "underline")
		});
		jQuery(".forpress").mouseout(function(){
			jQuery(this).children("img").attr("src","/images/arrow.gif")
			jQuery(this).children("a").css("text-decoration", "none")			
		});
		jQuery(".forpress").children("a").css("text-decoration", "none")
	//}
});
