﻿// JScript File
function getID(strElm)
{
	return  document.getElementById(strElm);	
}
function getForm(strFormName)
{
	return eval("document.forms['"+strFormName+"']");
}
function getAspForm()
{
	return getForm("aspnetForm");
}
function GetFormField(strFormName,strFieldName)
{
	return eval("getForm('"+strFormName+"')."+strFieldName);
}
function GetAspFormField(strFieldName)
{
	return GetFormField("aspnetForm",strFieldName);
}
function GetInnerHTML(strFieldName)
{
    var objID = getID(strFieldName);
	if (objID)
	{
		return objID.innerHTML;
	}
}
function SetImageSource(strImageItem, strSource)
{
    var objID = getID(strImageItem);
	if (objID)
	{
		objID.src = strSource ;
	}
}
function SetFormField(strFormName,strName,strValue)
{
	var objID = GetFormField(strFormName,strName);
	if (objID)
	{
		objID.value = strValue ;
	}	
}
function SetAspFormField(strName,strValue)
{
	SetFormField("aspnetForm",strName,strValue);
}
function SubmitForm(strFormName)
{
	var formObject;
	formObject = getForm(strFormName);
	if (formObject)
	{
		formObject.submit();
	}
}
function SubmitAspForm()
{
	SubmitForm('aspnetForm')
}
function ClearSelect(strFormName,strFieldName)
{
	var objSelect =  GetFormField(strFormName,strFieldName);
	if ( objSelect ){
		objSelect.disabled = true ;
		var intSelectLength = objSelect.options.length;
		for (var i=0 ; i < intSelectLength ;i++){
			objSelect.options[0] = null;
		}
		objSelect.disabled = false ;
	}
}
function ClearAspSelect(strFieldName)
{
	 ClearSelect("aspnetForm",strFieldName);
}
function FillSelectOption(strFormName,strFieldName,strText,strValue,blnSelected)
{
	var objSelect =  GetFormField(strFormName,strFieldName);	
	if ( objSelect ){
		objSelect.options[objSelect.options.length] = new Option(strText,strValue) ;
		if (blnSelected){
			objSelect.options[objSelect.options.length-1].selected = true ;
		}
	}	
}
function FillAspSelectOption(strFieldName,strText,strValue,blnSelected)
{
	FillSelectOption("aspnetForm",strFieldName,strText,strValue,blnSelected)
}
// Find text box on the form
function FillTextBox(strFieldName,strValue)
{
	var objTextbox = GetFormField("aspnetForm", strFieldName);
	if (objTextbox)
	{
		objTextbox.value=strValue;
	}
	else
	{
		objTextbox.value = "";
	}
}
function SetInnerHtml(strID,strText)
{
	var objID = getID(strID);
	if (objID)	objID.innerHTML = strText ;	
}

function AppendInnerHtml(strID,strText)
{
	var objID = getID(strID);
	if (objID)	objID.innerHTML += strText ;	
}

function ChangeClass(strID,strText)
{
    var objElm  = getID(strID);
    if (objElm)
	{
	    objElm.className = strText;
	}
}

/*Timed Scroll*/
var tmTimedScroll = null ;
var intCurrentScrollY = 0;
//var beginDate,endDate;
function TimedScrollTo(strTargetElm,strSourceElm,intMilliSeconds)
{   //Vertical Movement Only
    var objTargetElm = getID(strTargetElm);
    var objSourceElm = getID(strSourceElm);
    var TargetX, TargetY , SourceX , SourceY ,intTotalDifY,intScrollInterval,blnPositive;
    blnPositive = false;    
    if (objSourceElm)
    {
        SourceX = objSourceElm.x ? objSourceElm.x : objSourceElm.offsetLeft;
        SourceY = objSourceElm.y ? objSourceElm.y : objSourceElm.offsetTop;
    }
    if (objTargetElm)
    {
        TargetX = objTargetElm.x ? objTargetElm.x : objTargetElm.offsetLeft;
        TargetY = objTargetElm.y ? objTargetElm.y : objTargetElm.offsetTop;        
    } 
    
    intTotalDifY = Math.abs(TargetY - SourceY);
    intScrollInterval = Math.ceil(intMilliSeconds / intTotalDifY);
    
    if (intScrollInterval == 0) intScrollInterval = 1;    
    
    blnPositive = SourceY < TargetY;
    
    intCurrentScrollY = SourceY ;
    
    //beginDate = (new Date()).getMilliseconds();
    tmTimedScroll = setInterval("TimedScroll("+TargetX+","+TargetY+","+blnPositive+");",intScrollInterval);
}

function TimedScroll(intTargetScrollX,intTargetScrollY,blnPositive)
{    
    //status = "P1:"+(blnPositive && (intCurrentScrollY >= intTargetScrollY ))+"P2:"+(!blnPositive && (parseInt(intCurrentScrollY) <= parseInt(intTargetScrollY) ))
    //status = "TX="+intTargetScrollX+":TY="+intTargetScrollY+":CSY="+intCurrentScrollY+":P="+blnPositive;
    if ( (blnPositive && (parseInt(intCurrentScrollY) < parseInt(intTargetScrollY) )) || (!blnPositive && (parseInt(intCurrentScrollY) > parseInt(intTargetScrollY) )) )
    {
        intCurrentScrollY = (blnPositive ? intCurrentScrollY+5 :intCurrentScrollY -5);
        window.scrollTo(intTargetScrollX,intCurrentScrollY);
    }
    else
    {
        clearInterval(tmTimedScroll);
        //endDate = (new Date()).getMilliseconds();
    }
}
/*Timed Scroll*/
function ScrollTo(strElm)
{
    var objElm = getID(strElm);
    if (objElm)
    {
        var x = objElm.x ? objElm.x : objElm.offsetLeft,
        y = objElm.y ? objElm.y : objElm.offsetTop;
        window.scrollTo(x, y);
    }
}
function Hide(strElm)
{
	var objElm  = getID(strElm);
	if (objElm)
	{
		objElm.style.display = ( objElm.style.display == "none" ? "block" : "none" );
	}
	/* Style(strElm,'display','none') */
}

function Display(strElm)
{
	var objElm  = getID(strElm);
	if (objElm)
	{
		objElm.style.display = "block";
	}
	/* Style(strElm,'display','none') */
}

function NoDisplay(strElm)
{
	var objElm  = getID(strElm);
	if (objElm)
	{
		objElm.style.display = "none";
	}
	/* Style(strElm,'display','none') */
}

function HideRows(strElm)
{
	var objElm  = getID(strElm);
	if (objElm)
	{
		//objElm.className = (objElm.className == "hidden_fields" ? "" : "hidden_fields" );
		objElm.style.display = ('none' == objElm.style.display) ? 'block' : 'none';
		//(objElm.className == "hidden_fields" ? "none" : "")
	}
}

function ShowHideContent (elementID, baseClassName) {
    var objElm  = getID(elementID);
    if (objElm)
	{
		objElm.className = (objElm.className == baseClassName ? (baseClassName + " textmode") : baseClassName);
	}
}

function Style(strElm,strAttr,strVal)
{
	var objElm  = getID(strElm);
	if (objElm)
	{
		eval("objElm.style."+strAttr+"='"+strVal+"'");
	}
}

function Swap(strSource,strTarget)
{
	var objSrc  = getID(strSource);
	var objTrgt  = getID(strTarget);
	if (objSrc && objTrgt)
	{
		var strTmp = objSrc.innerHTML;
		objSrc.innerHTML = objTrgt.innerHTML;
		objTrgt.innerHTML = strTmp;
	}
}

function FocusInput(strName,strReplaceText)
{
	if (GetAspFormField(strName).value == strReplaceText ){
		GetAspFormField(strName).value = "";
	}
}

function BlurInput(strName,strReplaceText)
{
	if (GetAspFormField(strName).value == "" ){
		GetAspFormField(strName).value = strReplaceText;
	}
}

function CBSubmitByEnter(evt,strFunction,strParameter)
{
    var key = (window.Event) ? evt.which : evt.keyCode;
    if (key == 13)
	{
		var strEval = strFunction+"('"+strParameter+"')";
		eval(strEval);
	}
}


function SubmitByEnter(strFunction,strParameter)
{
	if (window.event.keyCode == 13)
	{
		var strEval = strFunction+"('"+strParameter+"')";
		eval(strEval);
	}
}

function GetEventSource(e) 
{
	if(e) {
		if(e.srcElement)
			return e.srcElement;
		else if(e.target)
			return e.target;
		else
			return null;
	}
	else {
		return null;
	}
}

function GetParentElement(obj) 
{
	if(obj) {
		if(obj.parentElement)
			return obj.parentElement;
		else if(obj.parentNode)
			return obj.parentNode;
		else
			return null;
	}
	else {
		return null;
	}
}

function getAbsoluteY (elm) {
    var y = 0;
    if (elm && typeof elm.offsetParent != "undefined") {
        while (elm && typeof elm.offsetTop == "number") {
        y += elm.offsetTop;
        elm = elm.offsetParent;
        }
    }
    return y;
}

function getAbsoluteX (elm) 
{
    var x = 0;
    if (elm && typeof elm.offsetParent != "undefined") {
        while (elm && typeof elm.offsetLeft == "number") {
        x += elm.offsetLeft;
        elm = elm.offsetParent;
        }
    }
    return x;
}

function getWindowY(e) {
    if (document.layers) {
        // When the page scrolls in Netscape, the event's mouse position
        // reflects the absolute position on the screen. innerHight/Width
        // is the position from the top/left of the screen that the user is
        // looking at. pageX/YOffset is the amount that the user has 
        // scrolled into the page. So the values will be in relation to
        // each other as the total offsets into the page, no matter if
        // the user has scrolled or not.
        yMousePos = e.pageY;
    } else if (document.all) {
        // When the page scrolls in IE, the event's mouse position 
        // reflects the position from the top/left of the screen the 
        // user is looking at. scrollLeft/Top is the amount the user
        // has scrolled into the page. clientWidth/Height is the height/
        // width of the current page the user is looking at. So, to be
        // consistent with Netscape (above), add the scroll offsets to
        // both so we end up with an absolute value on the page, no 
        // matter if the user has scrolled or not.
        yMousePos = window.event.y+document.body.scrollTop;
    } else if (document.getElementById) {
        // Netscape 6 behaves the same as Netscape 4 in this regard 
        yMousePos = e.pageY;
    }
    return yMousePos;
}

function UniqueID()
{
	return Math.floor(Math.random() * 1000000) * ((new Date()).getTime() % 1000);
}

function IsIE()
{
	if (window.ActiveXObject)
		return true;
	else
		return false;
}

function openBrowserWindow( strURL, strWindowName, strFeatures ) 
{
	window.open( strURL, strWindowName, strFeatures );
}

function SetPagingField(Fieldname,PageNumber)
{
    var strEval="getID('"+Fieldname+"').value="+PageNumber;
    eval(strEval);
}

function SetPaging(PagingIdentifier,PageNumber)
{
   GetAspFormField(PagingIdentifier+"PageNumber").value = PageNumber;
}
function SetAjaxPaging(PagingIdentifier,PageNumber,PostOperationFunction,PostOperationFunctionParams)
{
    SetPaging(PagingIdentifier,PageNumber);
    var strEval = PostOperationFunction+"('"+PostOperationFunctionParams+"')";
	eval(strEval);
}

/* Up And Down Operations */
// Used for controlling all the up & down operations 
// Can be used with paged lists
function GetArrayIndexForValue(arSource,intValue)
{
	var intReturn = -1;
	for (ArrIndex in arSource)
	{
		if (arSource[ArrIndex] == intValue )
			intReturn =  ArrIndex;			
	}
	return intReturn;
}
function MultiMove()
{
	this.ItemIndex = null;this.SourcePositionArrayIndex = null;this.TargetPositionIndex = null;	this.MaxPositionIndex = null;
	this.DivPrefix = null;this.intRangeBegin = null;this.intRangeEnd = null;this.PositionOrder = null;
	this.ExecuteMove = function()
	{	
		if (this.ItemIndex!=null && this.PositionOrder!=null && this.SourcePositionArrayIndex != null && this.TargetPositionIndex != null && this.MaxPositionIndex != null && this.intRangeBegin != null && this.intRangeEnd != null && this.DivPrefix != null)
		{
			var SourcePositionIndex = this.PositionOrder[this.SourcePositionArrayIndex];
			var arTemp = new Array();
			arTemp = this.PositionOrder.slice();
			// Source should be in the range	
			if ( SourcePositionIndex >= this.intRangeBegin &&  SourcePositionIndex <= this.intRangeEnd)
			{
				// Target in range
				if ( this.TargetPositionIndex >= this.intRangeBegin &&  this.TargetPositionIndex <= this.intRangeEnd)
				{
					// Target||Source = First||Last
					if (Math.abs(this.TargetPositionIndex - SourcePositionIndex) > 1)
					{
						if (this.TargetPositionIndex == 1 && SourcePositionIndex == this.MaxPositionIndex )// Last --> First
						{
							for(var i=this.intRangeEnd-1;i>=this.intRangeBegin;i--)
							{
								Swap(this.DivPrefix+(i),this.DivPrefix+(i+1));
								this.PositionOrder[GetArrayIndexForValue(arTemp,i)]= arTemp[GetArrayIndexForValue(arTemp,i+1)];
							}
						}
						else if (this.TargetPositionIndex == this.MaxPositionIndex && SourcePositionIndex == 1)// First --> Last
						{				
							for(var i=this.intRangeBegin+1;i<=this.intRangeEnd;i++)
							{
								Swap(this.DivPrefix+(i),this.DivPrefix+(i-1));
								this.PositionOrder[GetArrayIndexForValue(arTemp,i)]=arTemp[GetArrayIndexForValue(arTemp,i-1)];
							}
						}
						this.PositionOrder[GetArrayIndexForValue(arTemp,SourcePositionIndex)]= arTemp[GetArrayIndexForValue(arTemp,this.TargetPositionIndex)];					
					}
					// Consecutive Target&Source
					else if (Math.abs(this.TargetPositionIndex - SourcePositionIndex) == 1)
					{
						Swap(this.DivPrefix+SourcePositionIndex,this.DivPrefix+this.TargetPositionIndex);
						var intSrcArrIndex = GetArrayIndexForValue(this.PositionOrder,SourcePositionIndex);
						var intTrgtArrIndex = GetArrayIndexForValue(this.PositionOrder,this.TargetPositionIndex);
						if (intSrcArrIndex > 0 && intTrgtArrIndex > 0)
						{
							var strTemp =this.PositionOrder[intSrcArrIndex];
							this.PositionOrder[intSrcArrIndex]=this.PositionOrder[intTrgtArrIndex];
							this.PositionOrder[intTrgtArrIndex]= strTemp;
						}	
					}
				}
				// Target NOT in range
				else
				{
					if (this.TargetPositionIndex == 1 && SourcePositionIndex == this.MaxPositionIndex )// Last --> First
					{
						for(var i=this.intRangeEnd-1;i>=this.intRangeBegin;i--)
						{
							Swap(this.DivPrefix+(i),this.DivPrefix+(i+1));
							this.PositionOrder[GetArrayIndexForValue(arTemp,i)]= arTemp[GetArrayIndexForValue(arTemp,i+1)];
						}
						this.PositionOrder[GetArrayIndexForValue(arTemp,SourcePositionIndex)]=-1;
						Hide(this.DivPrefix+this.intRangeBegin);
						this.intRangeBegin++;
					}
					else if (this.TargetPositionIndex == this.MaxPositionIndex && SourcePositionIndex == 1)// First --> Last
					{				
						for(var i=this.intRangeBegin+1;i<=this.intRangeEnd;i++)
						{
							Swap(this.DivPrefix+(i),this.DivPrefix+(i-1));
							this.PositionOrder[GetArrayIndexForValue(arTemp,i)]=arTemp[GetArrayIndexForValue(arTemp,i-1)];
						}
						this.PositionOrder[GetArrayIndexForValue(arTemp,SourcePositionIndex)]=-1;
						Hide(this.DivPrefix+this.intRangeEnd);
						this.intRangeEnd--;
					}
					else
					{
						this.PositionOrder[GetArrayIndexForValue(this.PositionOrder,SourcePositionIndex)]=-1;
						if (this.TargetPositionIndex > SourcePositionIndex)
						{
							Hide(this.DivPrefix+SourcePositionIndex);
							this.intRangeEnd--;
						}
						else
						{
							Hide(this.DivPrefix+SourcePositionIndex);
							this.intRangeBegin++;	
						}				
					}			
				}
			}
			else
			{
				// Wrong Parameters
			}	
		}	
	}	
	this.DeleteOnly = function ()
	{
		if (this.ItemIndex!=null &&  this.TargetPositionIndex != null && this.intRangeBegin != null && this.intRangeEnd != null && this.DivPrefix != null)
		var arTemp = new Array();
		var ar = new Array();
		arTemp = this.PositionOrder.slice();
        
		for(var i=GetArrayIndexForValue(arTemp, this.TargetPositionIndex);i<this.intRangeEnd;i++)
		{          
            var next_i = parseInt(i)+1;
            
			Swap(this.DivPrefix+i, this.DivPrefix+(next_i));
			
			var temp = this.PositionOrder[next_i];
			this.PositionOrder[next_i] = this.PositionOrder[arTemp, i];
			this.PositionOrder[i] =temp;
			
		}
		
		Hide(this.DivPrefix+this.intRangeEnd);
		
		this.PositionOrder[this.intRangeEnd]=-1;
		
		this.intRangeEnd--;
	}	
	this.GetPositionOrder = function ()
	{
		return this.PositionOrder;
	}	
	this.GetRangeBegin = function ()
	{
		return this.intRangeBegin;
	}	
	this.GetRangeEnd = function ()
	{
		return this.intRangeEnd;
	}
}

function MultiMoveOperation(ItemIndex,SourceArrayIndex,TargetIndex,MaxPositionIndex)
{
	MM = new MultiMove();
	MM.ItemIndex = ItemIndex;
	MM.SourcePositionArrayIndex = SourceArrayIndex;
	MM.TargetPositionIndex = TargetIndex;
	MM.MaxPositionIndex = MaxPositionIndex;
	MM.DivPrefix = arDivPreFix[ItemIndex];
	MM.intRangeBegin = arRangeBegin[ItemIndex];
	MM.intRangeEnd = arRangeEnd[ItemIndex];
	MM.PositionOrder = arPositionOrder[ItemIndex];
	MM.ExecuteMove();
	arPositionOrder[ItemIndex] = MM.GetPositionOrder();
	arRangeBegin[ItemIndex] = MM.GetRangeBegin();
	arRangeEnd[ItemIndex] = MM.GetRangeEnd();
	MM = null;
}

function MultiDeleteFromMovable(ItemIndex,DeletedItemPositionIndex)
{
	MM = new MultiMove();
	MM.ItemIndex = ItemIndex;
	MM.TargetPositionIndex = DeletedItemPositionIndex;
	MM.DivPrefix = arDivPreFix[ItemIndex];
	MM.intRangeBegin = arRangeBegin[ItemIndex];	
	MM.intRangeEnd = arRangeEnd[ItemIndex];
	MM.PositionOrder = arPositionOrder[ItemIndex];
	MM.DeleteOnly();
	arPositionOrder[ItemIndex] = MM.GetPositionOrder();
	
	arRangeEnd[ItemIndex] = MM.GetRangeEnd();
	MM = null;
}
/* Up And Down Operations */

/*	Panel Related Operations	*/

var OpenedImg = new Image();
OpenedImg.src="/images/icon_panel_opened.gif";
var ClosedImg = new Image();
ClosedImg.src="/images/icon_panel_closed.gif";

var strOpenedImg = "/images/icon_panel_opened.gif";
var strClosedImg = "/images/icon_panel_closed.gif";
function ClosePanel( id )
{
	Hide("ShowHide_" + id);
	getID("Img_" + id).src = ( getID("ShowHide_" + id).style.display == "none" ? strClosedImg : strOpenedImg );
}
function CloseDynamicPanel(id)
{
	glbXmlRequest = new AkimanXmlHTTP(document.getElementById("loading"),document.getElementById("debug"));
	var	params = CustomParamBuilder("strOperation", "OpenClose");
	params += CustomParamBuilder("lngUniPanelID", id);
	var soapData = SoapDataBuilder("PanelOperations",params);
	AjaxRequest("/PanelOperation.asmx",soapData,"","loading");		
}
function MoveDynamicPanel(id,lngPanelRelationID,intPanelRelationType,strPanelGroupName,intMovementType)
{
	glbXmlRequest = new AkimanXmlHTTP(document.getElementById("loading"),document.getElementById("debug"));
	var	params = CustomParamBuilder("strOperation", "MoveUpDown");
	params += CustomParamBuilder("lngUniPanelID", id);
	params += CustomParamBuilder("lngPanelRelationID", lngPanelRelationID);
	params += CustomParamBuilder("intPanelRelationType", intPanelRelationType);	
	params += CustomParamBuilder("intMovementType", intMovementType);
	params += CustomParamBuilder("strPanelGroupName", strPanelGroupName);	
	var soapData = SoapDataBuilder("PanelOperations",params);
	AjaxRequest("/PanelOperation.asmx",soapData,"","loading");		
}

function MovePanel(SourceIndex,TargetIndex,PanelGroupName)
{
	var panel_src_id = PanelGroupName+"_"+SourceIndex;
	var panel_trgt_id = PanelGroupName+"_"+TargetIndex;
	Swap("Header_" + panel_src_id,"Header_" + panel_trgt_id);
	Swap("Content_" + panel_src_id,"Content_" + panel_trgt_id);
	Swap("DownImg_" + panel_src_id,"DownImg_" + panel_trgt_id);
	Swap("UpImg_" + panel_src_id,"UpImg_" + panel_trgt_id);
}

function UpdateDragablePanelGroup(strNewPositionOrder)
{
	glbXmlRequest = new AkimanXmlHTTP(document.getElementById("loading"),document.getElementById("debug"));
	var	params = CustomParamBuilder("strOperation", "UpdateDragablePanelGroup");
	params += CustomParamBuilder("strNewPositionOrder", strNewPositionOrder);
	var soapData = SoapDataBuilder("PanelOperations",params);
	AjaxRequest("/PanelOperation.asmx",soapData,"","loading");		
}

function ImageViewer(ImageID,ContentID,ContentType)
{
	var strViewerAddress = "/image_view.aspx?lngImageID="+ImageID+"&lngContentID="+ContentID+"&intMainContentType="+ContentType;
	var ViewerWindow=window.open(strViewerAddress, "ViewerWindow", "width=800,height=600,resizable=yes,scrollbars=yes");
	ViewerWindow.moveTo(50,50);
}


/*	Panel Related Operations	*/

/* Global Overlay*/

function DynamicOverlay(strID)
{
    var objID = getID(strID);
    if (objID)    DynamicOverlayByObj(objID);
}

function DynamicOverlayByObj(objClickedElement)
{
    var y_Value = getAbsoluteY(objClickedElement)-225;
    
    Overlay();
    
    var objOverlayFront = getID("OverlayFront");
    if (objOverlayFront) 
    {
        objOverlayFront.style.top = y_Value +"px";
    }
}

function Overlay()
{
    Hide("OverlayBack");Hide("OverlayFront");
}

function ShareVideo(strURL)
{
    //strURL = "/sharevideo.aspx";
    SetInnerHtml("OverlayFront","<iframe src="+strURL+" width='380px' height='320px' border='0' style='overflow:hidden;border:2px solid #037ba7'></iframe>");
//    getID("ShareFrame").style.display='block';
//    getID("ShareFrame").setAttribute('src',strURL);
    HideObjects(true);
    Overlay();
}

function HideObjects(blnHide)
{
    var arObjects = document.getElementsByTagName("object");
    
    if (arObjects.length == 0)
    {
        arObjects = document.getElementsByTagName("embed");
    }
    if (arObjects && arObjects.length && arObjects.length > 0)
    {
        for (var i = 0; i < arObjects.length;i++)
        {
            arObjects[i].style.display = (blnHide ? "none" : "block");
        }
    }
}

function JSBack()
{
 history.back();
}

function FlashVideoPlayer(strFileName,strMovieUrl,strWidth,strHeight,lngVideoID)
{
    if (swfobject)
	{
	    var attributes = {  
		id:strFileName,
		name: strFileName};
	    
	    var params = {quality:"high",
		align:"middle",
		play:"true",
		loop:"true",
		scale:"showall",
		wmode:"opaque",
		devicefont:"false",
		bgcolor:"#cccccc",
		menu:"true",
		allowScriptAccess:"sameDomain",
		salign:""};
		
	    var flashvars = { 
	    fileName:strFileName};
	    
	    swfobject.embedSWF(strMovieUrl, "FlashVideo_"+lngVideoID, strWidth, strHeight, "7", false, flashvars, params, attributes);
    }
}

function NewFlashVideoPlayer(strFileName,strMovieUrl,strConfigUrl,strWidth,strHeight,lngVideoID)
{
    if (swfobject)
	{
	    var attributes = {  
		id:strFileName,
		name: strFileName};
	    
	    var params = {quality:"high",
		align:"middle",
		play:"true",
		loop:"true",
		scale:"showall",
		wmode:"opaque",
		devicefont:"false",
		bgcolor:"#cccccc",
		menu:"true",
		allowScriptAccess:"sameDomain",
		allowfullscreen:"true",
		config:strConfigUrl.replace(/&/,"%26"),
		flashvarsconfig: strConfigUrl,
		salign:""};

	    var flashvars = { 
	    fileName:strFileName,
		config:strConfigUrl,
		flashvarsconfig:strConfigUrl};
	    
	    swfobject.embedSWF(strMovieUrl, "FlashVideo_"+lngVideoID, strWidth, strHeight, "7", false, flashvars, params, attributes);
    }
}

function Redirect(strUrl)
{
    window.location = strUrl;
}
function OpeniFrameLayer(strURL,objClickedElement)
{
    SetInnerHtml("OverlayFront","<a href=\"#\" onclick=\"CloseiFrameLayer(this)\">Close</a><br/><iframe src='"+strURL+"' width='800px' height='325px' border='0' style='overflow:hidden;border:2px solid #037ba7'></iframe>");
    HideObjects(true);
    DynamicOverlayByObj(objClickedElement);
}
function CloseiFrameLayer(objClickedElement)
{
    HideObjects(false);
}
