// JavaScript Document
var Value_TopBanner = 1;
var BannerImageStart = 1;
function Remove_Value(Id,Value) {
	document.getElementById(Id).value = Value;
}

function Remove_Value_MainDocument(Id,Value) {
	parent.document.getElementById(Id).value = Value;
}

function Class_Name_Change(Id ,ClassName) {
	document.getElementById(Id).setAttribute("class", ClassName);
}

function FormSubmit() {
	FRM.submit();
}

function Display_Div(CId, Display_Con)
{
	document.getElementById(CId).style.display = Display_Con;
}

function Display_Iframe(CId, Display_Con)
{
	document.getElementById(CId).style.visibility = Display_Con;
}

function Remove_Src_MainDocument(Id,Value) {
	document.getElementById(Id).src = Value;
}

function Display_Iframe_MainDocument(CId, Display_Con)
{
	parent.document.getElementById(CId).style.visibility = Display_Con;
}

function Display_Div_INFrame(CId, Display_Con)
{
	parent.document.getElementById(CId).style.display = Display_Con;
}

function Display_OnOff_Div(CId)
{
	Display = document.getElementById(CId).style.display ;
	if (Display == "none")
	document.getElementById(CId).style.display = "" ;
	else
	document.getElementById(CId).style.display = "none" ;
}

function ImageSrc_one_two(IId ,DId ,Src1 ,Src2)
{
	Display = document.getElementById(DId).style.display ;
	if (Display == "none")
	document.getElementById(IId).src = Src1 ;
	else
	document.getElementById(IId).src = Src2 ;
}

function Rating_bar(IId1 ,IId2 ,IId3 ,IId4 ,IId5 ,Src1 ,Src2 ,MSG ,InputMSG , EndLoop , TotalLoop)
{
	var IMG = new Array();
	IMG[0] = IId1;
	IMG[1] = IId2;
	IMG[2] = IId3;
	IMG[3] = IId4;
	IMG[4] = IId5;
	for (i = 0; i < TotalLoop; i++) {
		document.getElementById(IMG[i]).src = Src1;
	}
	for (i = 0; i < EndLoop; i++) {
		document.getElementById(IMG[i]).src = Src2;
	}
	//***************************MSG**************
	document.getElementById(InputMSG).innerHTML = "<strong>" + MSG + "</strong>";
	//********************************************
}

function Rating_Fix(HId , Total) {
	document.getElementById(HId).value = Total;
}

function Rating_barOut(IId1 ,IId2 ,IId3 ,IId4 ,IId5 ,Src1 ,Src2 ,MSG ,InputMSG , TotalRatioFix, TotalLoop)
{
	EndLoop = document.getElementById(TotalRatioFix).value;
	var IMG = new Array();
	IMG[0] = IId1;
	IMG[1] = IId2;
	IMG[2] = IId3;
	IMG[3] = IId4;
	IMG[4] = IId5;
	for (i = 0; i < TotalLoop; i++) {
		document.getElementById(IMG[i]).src = Src1;
	}
	
	for (i = 0; i < EndLoop; i++) {
		document.getElementById(IMG[i]).src = Src2;
	}
	//***************************MSG**************
	document.getElementById(InputMSG).innerHTML = "<strong>" + MSG + "</strong>";
	//********************************************
}

function Display_OnOff_Div_Loop(CId ,Start ,TotalRows ,Display_Condition)
{
	for (i = Start; i < TotalRows; i++) {
		document.getElementById(CId+i).style.display = Display_Condition ;
	}
}

function Main_Tab(ID, T_Id, BGColor)
{
	document.getElementById("AudioDetail").style.display = "none";	
	document.getElementById("VideoDetail").style.display = "none";	
	document.getElementById("ImageDetail").style.display = "none";	
	document.getElementById("NewsDetail").style.display = "none";
	
	document.getElementById("News").setAttribute("bgcolor", '');
	document.getElementById("Images").setAttribute("bgcolor", '');
	document.getElementById("Vide").setAttribute("bgcolor", '');
	document.getElementById("Audio").setAttribute("bgcolor", '');
	
	document.getElementById(ID).style.display = "";
	document.getElementById(T_Id).setAttribute("bgcolor", '#'+BGColor);
}

function HeaderImage()
{
	Total_Banners = document.getElementById("TotalBannerImages").value;
	if (Total_Banners >= BannerImageStart) {
		parent.document.getElementById("Mainbanner").src = document.getElementById("BannerHiddenFiled"+BannerImageStart).value;	
		parent.document.getElementById("Mainbanner").title = document.getElementById("BannerHiddenFiled_Title"+BannerImageStart).value;	
		BannerImageStart++;
		if (BannerImageStart == Total_Banners)
		BannerImageStart = 1
	}
}

function SetTimerHeaderBanner(){
	setInterval("HeaderImage()" , 5000);
	}
	
window.load = SetTimerHeaderBanner();

function WindowLocation(Location)
{
	window.location = Location;
}

function FormUrlTarge(Form, UrlTarget)
{
	document.getElementById(Form).target = UrlTarget;
}

function IframeFieldValueToOther(FieldNameFrom , FieldNameTo)
{
	Iframe_Image = upload_target.document.getElementById(FieldNameFrom).value;
	document.getElementById(FieldNameTo).value = Iframe_Image;
}