function senduid(id,mid,embed){
var temp;


document.getElementById('uid2').value=id;
document.getElementById('mid').value=mid;
if(document.getElementById('srcmovie'))
    document.getElementById('srcmovie').value='http://www.tudu.co.il/main/movieshow.asp?movieid='+mid;
if(document.getElementById('embedmovie'))
   document.getElementById('embedmovie').value=embed;

}
function setmovietext(title,desc,id,counter){
var temp;
if(document.getElementById('titlemovie')){
document.getElementById('titlemovie').innerHTML= title;} 


if(document.getElementById('namePage'))
  { 
      if(document.getElementById('namePage').value=='movieshow')
        {
            if(document.getElementById('counter'))
               document.getElementById('counter').innerHTML = counter;
 
          if(document.getElementById('descriptionmovie'))
           {
             
             document.getElementById('descriptionmovie').innerHTML = desc ;
             if(document.getElementById('title'))
               document.getElementById('title').innerHTML= title;
            } 
         }  
      else
        {   
         if(document.getElementById('descriptionmovie'))
          {
             
             document.getElementById('descriptionmovie').innerHTML = desc + '<br>'+counter;
             if(document.getElementById('title'))
                   document.getElementById('title').innerHTML= title;
           } 
        }
   
   }    
else
  {  
    if(document.getElementById('descriptionmovie'))
      {
        
         document.getElementById('descriptionmovie').innerHTML = desc + '<br>'+counter;
         if(document.getElementById('title'))
           document.getElementById('title').innerHTML= title;
       } 
   }


}




// Validations
function ValNotEmpty(o, s) {
	if (o.length==0) { alert(s); return true; } else { return false; }
}
function ValEqual(o1, o2, s) {
	if (!(o1==o2)) { alert(s); return true; } else { return false; }
}
function ValNum(o, s) {
	if (isNaN(o)) { alert(s); return true; } else { return false; }
}
function ValEmail(o, s) {
	if (!ValidateEmail(o)) { alert(s); return true; } else { return false; }
}
function ValidateEmail(str) {
	var filter=/^.+@.+\..{2,3}$/
	return filter.test(str);
}

function setselect(a, str) {
	if (a)
	{
		for (i=0; i<a.length; i++) 
			if (a[i].value == str) 
				a.selectedIndex = i
	}
}

function setmselect(a, str) {
	if (a)
	{
		for (i=0; i<a.length; i++) 
			if (a[i].value == str) 
				a[i].selected = true;
	}
}

function changeV(tr)
{
	if(document.getElementById(tr).style.display == "none")
		document.getElementById(tr).style.display = "block";
	else
		document.getElementById(tr).style.display = "none";
}

function iFrameHeight(ifrname){
	var minHeight = 200;
	h = document.getElementById(ifrname).document.body.scrollHeight;
	if (h > minHeight) {
		document.getElementById(ifrname).height = h;
	} else {
		document.getElementById(ifrname).height = minHeight;
	}
}


function myround(n, d) {
	var x = Math.round(n * Math.pow(10, d)) / Math.pow(10, d);
	var sign = (x < 0);
	if (sign) { x *= -1; }
	var s = x + '';
	if (s.indexOf('.') == -1) s += '.';
	var l = s.length;
	var p = s.indexOf('.');
	for (var i=0;i<=d-l+p;i++) { s += '0'; }
	//p = s.indexOf('.');
	//while (p > 3) { p -= 3; s = s.substr(0, p) + ',' + s.substr(p, 1000); }
	if (d == 0) { s = s.replace('.',''); }
	if (sign) { s = '-' + s; }
	return parseFloat(s);
} 

function myformat(n, d) {
	var x = Math.round(n * Math.pow(10, d)) / Math.pow(10, d);
	var sign = (x < 0);
	if (sign) { x *= -1; }
	var s = x + '';
	if (s.indexOf('.') == -1) s += '.';
	var l = s.length;
	var p = s.indexOf('.');
	for (var i=0;i<=d-l+p;i++) { s += '0'; }
	p = s.indexOf('.');
	while (p > 3) { p -= 3; s = s.substr(0, p) + ',' + s.substr(p, 1000); }
	if (d == 0) { s = s.replace('.',''); }
	if (sign) { s = '-' + s; }
	return s;
} 


function PutInDiv(strDivId,str) {
	document.getElementById(strDivId).innerHTML = str;
}

function ismaxlength(obj){
var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
if (obj.getAttribute && obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)
}


function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
  return blnResult;
}
        function myFunction(arg) {
	alert('You clicked from item ' + arg + ' !\n\nExecute your function here...');
        }
         
function OpenMedia(pid,strurl)
 {
//   window.open('OpenMedia.asp?Pid='+pid+'&Url='+strurl,null,'directories=yes,location=yes,menubar=yes,scrollbars=yes,toolbar=yes,status=yes,width=720,height=600');
   window.open('OpenMedia.asp?Pid='+pid+'&Url='+strurl,null,'');
 }

function createPlayer(theFile,w,h,IconType) 
{
if(w == null)
   w="450";
if(h == null)
   h="370";

if(IconType == 1)
{
           var flashvars = {
                    file:theFile, 
                    autostart:"false", 
                    playlistsize:"100",
                   // playlist:"bottom",
                    linktarget:"_self",
                    //displayclick:"link",
                  //- skin:"http://www.jeroenwijering.com/upload/overlay.swf",
                    lightcolor:"cc9900",
                    repeat:"list",
                    controlbar:"over"
                   // overstretch:"true",
                   //logo:"http://www.tudu.co.il/main/img/BackgroundLink.png" ,
				   //link:"http://www.tudu.co.il",
				   //linkfromdisplay:"true"
				   
				   
            
            //quality:"false"
            //overstretch:"true",
			
	//usefullscreen:"true"
            //bufferlength:"5"
            //smoothing:"false"
            }

}
else
{
           var flashvars = {
                    file:theFile, 
                    autostart:"false", 
                    playlistsize:"100",
                    linktarget:"_self",
                  //- skin:"http://www.jeroenwijering.com/upload/overlay.swf",
                    lightcolor:"cc9900",
                    repeat:"list",
                    controlbar:"over"
            }

}   
             var params = {
            
                    allowfullscreen:"true", 
                    allowscriptaccess:"always",
		    WMode:"opaque"
		    //WMode:"Transparent"
            }
            var attributes = {
                    id:"player1",  
                    name:"player1"
            }
            swfobject.embedSWF("movie/player.swf", "container", w, h, "9.0.115", false, flashvars, params, attributes);

 }

function setMediaActive(Pid,PUrl,w,h,IconType) 
{
if(IconType==1)
{

var ImgLink;

var ImgH;
ImgH = h/4;

document.getElementById('tdP').innerHTML="<div onclick='OpenMedia(\""+Pid+"\",\""+PUrl+"\");' style='width:"+w+";height:"+ImgH+";position:absolute;z-index:1000;'><table width='100%' height='100%' border=0><tr><td width=100%'></td></tr></table></div>"+document.getElementById('tdP').outerHTML;
//document.getElementById('tdP').innerHTML="<img border='0' onclick='OpenMedia(\"4\",\"http://www.bebroker.co.il\");' src='img/BackgroundLink.png' style='width:"+w+";height:"+ImgH+";position:absolute;z-index:1000'>"+document.getElementById('tdP').outerHTML;
}

}


            
            