// JavaScript Document
// Global js functions used on NetVisionTV.com
function getclient(){
updateaccount.downloadedconnector.value=1;
}

function clearprofile(targetName) {
		if ( targetName == "bgcolor" || targetName == "all") {
			if( document.getElementById ) { // NS6+
				target = document.getElementById("bgcolor");
			} else if( document.all ) { // IE4+
				target = document.all["bgcolor"];
			}
			target.value = '';
		}
		if ( targetName == "textcolor" || targetName == "all") {
			if( document.getElementById ) { // NS6+
				target = document.getElementById("textcolor");
			} else if( document.all ) { // IE4+
				target = document.all["textcolor"];
			}
			target.value = '';
		}
		if ( targetName == "linkcolor" || targetName == "all") {
			if( document.getElementById ) { // NS6+
				target = document.getElementById("linkcolor");
			} else if( document.all ) { // IE4+
				target = document.all["linkcolor"];
			}
			target.value = '';
		}
		
		document.profile.submit();
}

function changec(){
document.searchg.action ="search_group.cfm";	
searchg.submit();		
}


function checkcountry(selectObj) {
	hideall();
	//if (selectObj.options[selectObj.selectedIndex].id == 221) {
		//showstates();
	//}
	//else {
		showregion("region" + selectObj.options[selectObj.selectedIndex].id);
	//}
}

function showstates() {
        if( document.getElementById ) { // NS6+
            target = document.getElementById("states");
        } else if( document.all ) { // IE4+
            target = document.all["states"];
        }
        if( target ) {
            if( target.style.display == "none" ) {
                target.style.display = "block";
            } 
        }
}

function showregion(targetName) {
        if( document.getElementById ) { // NS6+
            target = document.getElementById(targetName);
        } else if( document.all ) { // IE4+
            target = document.all[targetName];
        }
        if( target ) {
            if( target.style.display == "none" ) {
                target.style.display = "block";
            } 
        }
}

function hideall() {
		// hide states
		if( document.getElementById ) { // NS6+
            target = document.getElementById("states");
        } else if( document.all ) { // IE4+
            target = document.all["states"];
        }
        if( target ) {
            if( target.style.display == "block" ) {
                target.style.display = "none";
            } 
        }
		// hide all other regions

		for(i = 0; i < 244; i++) {
			region = "region" + i;
        if( document.getElementById ) { // NS6+
            target = document.getElementById(region);
        } else if( document.all ) { // IE4+
            target = document.all[region];
        }
        if( target ) {
            if( target.style.display == "block" ) {
                target.style.display = "none";
            } 
        }
	}
}

function checkpublic(a){	
	if (a == 'public1'){
		document.getElementById('private0').checked=true;
		document.getElementById('private1').checked=false;	
	}
	if (a == 'public0'){
		document.getElementById('private0').checked=false;
		document.getElementById('private1').checked=true;	
	}
	if (a == 'private1'){
		document.getElementById('public0').checked=true;
		document.getElementById('public1').checked=false;	
	}
	if (a == 'private0'){
		document.getElementById('public0').checked=false;
		document.getElementById('public1').checked=true;	
	}
}
function opencam(){
	window.open('/showcam.cfm?mtype=31&mto=0','camerawindow','width=610,height=380') 
}
function opencam2(){
	var selObj = document.getElementById('toid');
	var aa = selObj.selectedIndex;
	var bb = selObj.options[aa].value;
	//alert(selObj.options[aa].text);
	var tv = 'http://www.netvisiontv.com/showcam.cfm?mtype=2&mto=' + bb;
	//alert(tv);
	window.open(tv,'camerawindow','width=610,height=380,resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,titlebar=no,fullscreen=no') 
}
function opencam3(g){
	var tv = 'http://www.netvisiontv.com/showcam.cfm?mtype=0&mto=' + g;
	window.open(tv,'camerawindow','width=610,height=380,resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,titlebar=no,fullscreen=no') 
}
function opencam4(g){
	var tv = 'http://www.netvisiontv.com/showcam.cfm?mtype=4&mto=' + g;
	window.open(tv,'camerawindow','width=610,height=380,resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,titlebar=no,fullscreen=no') 
}
function opencam5(g){
	var tv = 'http://www.netvisiontv.com/showcam.cfm?mtype=3&mto=' + g;
	window.open(tv,'camerawindow','width=610,height=380,resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,copyhistory=no,titlebar=no,fullscreen=no') 
}
function openmovie(u,src){
	if ( src.toUpperCase().indexOf(".MOV") > -1 ){

		var f = '/users/' + u + '/videos/' + src;
		window.open(f,'moviewindow','width=356,height=494,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=0');
	}else{

		var f = '/showmovie.cfm?m=' + src + '&u=' + u;
		window.open(f,'moviewindow','width=340,height=275,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=0');
	}
}
function showhide(targetName) {
        if( document.getElementById ) { // NS6+
            target = document.getElementById(targetName);
        } else if( document.all ) { // IE4+
            target = document.all[targetName];
        }
        if( target ) {
            if( target.style.display == "none" ) {
                target.style.display = "block";
				if(targetName == "showlists"){
					document.images["arrow_lists"].src = "/images/arrow_down.gif";
				}
				else if(targetName == "showfollowing") {
					document.images["arrow_looking"].src = "/images/arrow_down.gif";
				}
            } else {
                target.style.display = "none";
				if(targetName == "showlists"){
					document.images["arrow_lists"].src = "/images/arrow_up.gif";
				}
				else if(targetName == "showfollowing") {
					document.images["arrow_looking"].src = "/images/arrow_up.gif";
				}
            }
        }
} 
function showhide2(targetName) {
        //alert(targetName);
				if( document.getElementById ) { // NS6+
            target = document.getElementById(targetName);
        } else if( document.all ) { // IE4+
            target = document.all[targetName];
        }
        if( target ) {
            //alert(target.style.display);
			if( target.style.display == "inline" ) {
                target.style.display = "none";
            } else {
                target.style.display = "inline";
            }
        }
} 
function showit(targetName) {
        if( document.getElementById ) { // NS6+
            target = document.getElementById(targetName);
        } else if( document.all ) { // IE4+
            target = document.all[targetName];
        }
        if( target ) {
            target.style.display = "inline";
        }
} 
function hideit(targetName) {
        if( document.getElementById ) { // NS6+
            target = document.getElementById(targetName);
        } else if( document.all ) { // IE4+
            target = document.all[targetName];
        }
        if( target ) {
            target.style.display = "none";
        }
} 
function showm(a,b){
	if( document.getElementById ) { // NS6+
		a = document.getElementById(a);
	} else if( document.all ) { // IE4+
		a = document.all[a];
	}
	if( a ) {
		//target.style.display = "inline";
		a.className="clear lnht15 bg1";
	}
	if( document.getElementById ) { // NS6+
		b = document.getElementById(b);
	} else if( document.all ) { // IE4+
		b = document.all[b];
	}
	if( b ) {
		b.style.display = "inline";
	}
} 
function hidem(a,b){
	if( document.getElementById ) { // NS6+
		a = document.getElementById(a);
	} else if( document.all ) { // IE4+
		a = document.all[a];
	}
	if( a ) {
		//target.style.display = "inline";
		a.className="clear lnht15 bg1off";
	}
	if( document.getElementById ) { // NS6+
		b = document.getElementById(b);
	} else if( document.all ) { // IE4+
		b = document.all[b];
	}
	if( b ) {
		b.style.display = "none";
	}
} 
function showm(a,b,c){
	if( document.getElementById ) { // NS6+
		a = document.getElementById(a);
	} else if( document.all ) { // IE4+
		a = document.all[a];
	}
	if( a ) {
		//target.style.display = "inline";
		a.className="clear lnht15 bg1";
	}
	if( document.getElementById ) { // NS6+
		b = document.getElementById(b);
	} else if( document.all ) { // IE4+
		b = document.all[b];
	}
	if( b ) {
		b.style.display = "inline";
	}
	if( document.getElementById ) { // NS6+
		c = document.getElementById(c);
	} else if( document.all ) { // IE4+
		c = document.all[c];
	}
	if( c ) {
		c.style.display = "none";
	}
} 
function hidem(a,b,c){
	if( document.getElementById ) { // NS6+
		a = document.getElementById(a);
	} else if( document.all ) { // IE4+
		a = document.all[a];
	}
	if( a ) {
		//target.style.display = "inline";
		a.className="clear lnht15 bg1off";
	}
	if( document.getElementById ) { // NS6+
		b = document.getElementById(b);
	} else if( document.all ) { // IE4+
		b = document.all[b];
	}
	if( b ) {
		b.style.display = "none";
	}
	if( document.getElementById ) { // NS6+
		c = document.getElementById(c);
	} else if( document.all ) { // IE4+
		c = document.all[c];
	}
	if( c ) {
		c.style.display = "inline";
	}
} 
function showm2(a,b){
	if( document.getElementById ) { // NS6+
		a = document.getElementById(a);
	} else if( document.all ) { // IE4+
		a = document.all[a];
	}
	if( a ) {
		//target.style.display = "inline";
		a.className="group_list_on";
	}
	if( document.getElementById ) { // NS6+
		b = document.getElementById(b);
	} else if( document.all ) { // IE4+
		b = document.all[b];
	}
	if( b ) {
		b.style.display = "inline";
	}
} 
function hidem2(a,b){
	if( document.getElementById ) { // NS6+
		a = document.getElementById(a);
	} else if( document.all ) { // IE4+
		a = document.all[a];
	}
	if( a ) {
		//target.style.display = "inline";
		a.className="group_list_off";
	}
	if( document.getElementById ) { // NS6+
		b = document.getElementById(b);
	} else if( document.all ) { // IE4+
		b = document.all[b];
	}
	if( b ) {
		b.style.display = "none";
	}
} 
function showm3(a,b){
	if( document.getElementById ) { // NS6+
		a = document.getElementById(a);
	} else if( document.all ) { // IE4+
		a = document.all[a];
	}
	if( a ) {
		//target.style.display = "inline";
		a.className="list_on";
	}
	if( document.getElementById ) { // NS6+
		b = document.getElementById(b);
	} else if( document.all ) { // IE4+
		b = document.all[b];
	}
	if( b ) {
		b.style.display = "inline";
	}
} 
function hidem3(a,b){
	if( document.getElementById ) { // NS6+
		a = document.getElementById(a);
	} else if( document.all ) { // IE4+
		a = document.all[a];
	}
	if( a ) {
		//target.style.display = "inline";
		a.className="list_off";
	}
	if( document.getElementById ) { // NS6+
		b = document.getElementById(b);
	} else if( document.all ) { // IE4+
		b = document.all[b];
	}
	if( b ) {
		b.style.display = "none";
	}
} 
function showm3(a,b,c){
	if( document.getElementById ) { // NS6+
		a = document.getElementById(a);
	} else if( document.all ) { // IE4+
		a = document.all[a];
	}
	if( a ) {
		//target.style.display = "inline";
		a.className="list_on";
	}
	if( document.getElementById ) { // NS6+
		b = document.getElementById(b);
	} else if( document.all ) { // IE4+
		b = document.all[b];
	}
	if( b ) {
		b.style.display = "inline";
	}
	if( document.getElementById ) { // NS6+
		c = document.getElementById(c);
	} else if( document.all ) { // IE4+
		c = document.all[c];
	}
	if( c ) {
		c.style.display = "none";
	}
} 
function hidem3(a,b,c){
	if( document.getElementById ) { // NS6+
		a = document.getElementById(a);
	} else if( document.all ) { // IE4+
		a = document.all[a];
	}
	if( a ) {
		//target.style.display = "inline";
		a.className="list_off";
	}
	if( document.getElementById ) { // NS6+
		b = document.getElementById(b);
	} else if( document.all ) { // IE4+
		b = document.all[b];
	}
	if( b ) {
		b.style.display = "none";
	}
	if( document.getElementById ) { // NS6+
		c = document.getElementById(c);
	} else if( document.all ) { // IE4+
		c = document.all[c];
	}
	if( c ) {
		c.style.display = "inline";
	}
} 
function showm4(a,b){
	if( document.getElementById ) { // NS6+
		a = document.getElementById(a);
	} else if( document.all ) { // IE4+
		a = document.all[a];
	}
	if( a ) {
		//target.style.display = "inline";
		a.className="list_on1";
	}
	if( document.getElementById ) { // NS6+
		b = document.getElementById(b);
	} else if( document.all ) { // IE4+
		b = document.all[b];
	}
	if( b ) {
		b.style.display = "inline";
	}
} 
function hidem4(a,b){
	if( document.getElementById ) { // NS6+
		a = document.getElementById(a);
	} else if( document.all ) { // IE4+
		a = document.all[a];
	}
	if( a ) {
		//target.style.display = "inline";
		a.className="list_off1";
	}
	if( document.getElementById ) { // NS6+
		b = document.getElementById(b);
	} else if( document.all ) { // IE4+
		b = document.all[b];
	}
	if( b ) {
		b.style.display = "none";
	}
} 
function showsubcat(a) {	
	var divs=document.getElementsByTagName('div') 
	for (var i=0;i<divs.length;i++){ 
		var v1=a + "_";
		
		if (	divs[i].id.search(v1) != -1 	){			
			//divs[i].style.display = 'inline';
			if( divs[i].style.display == 'inline' ) {
      	divs[i].style.display = 'none';
      } else {
      	divs[i].style.display = 'inline';
      }
		}
	}
} 
function showsubcat1(a) {
        var img = 'img_' + a;
		if( document.getElementById ) { // NS6+
            target = document.getElementById(a);
        } else if( document.all ) { // IE4+
            target = document.all[a];
        }
		if( target ) {
            if( target.style.display == "none" ) {
                target.style.display = "inline";
				document.images[img].src = "/images/collapse.png";
            } else {
                target.style.display = "none";
				document.images[img].src = "/images/expand.png";
            }
        }
} 
function updatecat(c){
	document.getElementById('cid').value=c;
	
}
function reply(a){
	document.addpost.news.value=a;
	document.addpost.news.focus();
}
function reply2(a,b){
	if( document.getElementById ) { // NS6+
		b = document.getElementById(b);
	} else if( document.all ) { // IE4+
		b = document.all[b];
	}
	if( b ) {
		b.style.display = "inline";
	}
	document.addpost.news.value=a;	
	document.addpost.news.focus();
}
function change(src){
	showit('pdesc');
	showit('vplayer');
	document.getElementById('vplayer').innerHTML = '<embed src="' + src + '"  type="application/x-shockwave-flash" wmode="transparent" width="420" height="355"  quality="high" bgcolor="#00ccff" name="fullscreen" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true"  pluginspage="http://www.adobe.com/go/getflashplayer" /></embed>';
}
function  showmov(lname,swfname,vidid,vidtime){
  showhide(lname);
  //tmp = findSWF(swfname);  
  //alert(tmp);
  x = swf1.reload();
  //eval('x = swf1.reload("player.swf?video_id=' + vidid + '&video_time=' + vidtime + '&URI=rtmp://#CGI.SERVER_NAME#/oflaDemo&START=0")');
}
function submitenter(myfield,e){
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	if (keycode == 13)
	   {
	   myfield.form.submit();
	   return false;
	   }
	else
	   return true;
}
function copyCB()
{
 document.ad_select.code_box.focus();
 document.ad_select.code_box.select();
 copyText = document.selection.createRange();
 copyText.execCommand("Copy");
}
function changebi(i){
	document.body.background = i;
}
