function plurk_click(t , u) {
            window.open('http://www.plurk.com/?qualifier=shares&amp;status=' .concat(encodeURIComponent(u)) .concat(' ') .concat('(') .concat(encodeURIComponent(t)) .concat(')'))
}

function fbs_click(t, u , p) {
            window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]=' + encodeURIComponent(t) +'&amp;p[url]=' + encodeURIComponent(u) + '&amp;p[images][0]=' + encodeURIComponent(p), 'sharer', 'toolbar=0,status=0,width=626,height=436');
} 
function ShowModalDialog(URL , Arguments , width , height , left, top , isCenter, Resizable , ScrollBars , StatusBar ) {

    var dialogStyle = "";
    if(width != 0)
        dialogStyle += "DialogWidth: " + width + "px;";
    if(height != 0)
        dialogStyle += "DialogHeight: " + height + "px;";
    if(left != 0)
        dialogStyle += "DialogLeft: " + left + ";";
    if(top != 0)
        dialogStyle += "DialogTop: " + top + ";";
    if(navigator.userAgent.indexOf("Firefox")!=-1) {
    } else {
    if(isCenter)
        dialogStyle += "center: yes;";
    else
        dialogStyle += "center: no;";
    }
 
    if(Resizable)
        dialogStyle += "resizable: yes;";
    else
        dialogStyle += "resizable: no;";
        
    if(ScrollBars)
        dialogStyle += "scroll: yes;";
    else
        dialogStyle += "scroll: no;";
        
    if(StatusBar)
        dialogStyle += "status: yes;";
    else
        dialogStyle += "status: no;";
        
//    style += "center:" +(isCenter==true?  "yes": "no") + ";" ;
//    style += "resizable:" +(Resizable==true?  "yes": "no") + ";" ;
//    style += "scroll:" +(ScrollBars==true?  "yes": "no") + ";" ;
//    style += "status:" +(StatusBar==true?  "yes": "no") + ";" ;
    
    if(navigator.userAgent.indexOf("Firefox")!=-1) {
        //dialogStyle = replaceAll(dialogStyle, ':', '='); 
        //dialogStyle = replaceAll(dialogStyle, ';', ','); 
        //dialogStyle = replaceAll(dialogStyle, 'DialogWidth', 'width');
        //dialogStyle = replaceAll(dialogStyle, 'DialogHeight', 'Height');
        //dialogStyle = replaceAll(dialogStyle, 'DialogLeft', 'left');
        //dialogStyle = replaceAll(dialogStyle, 'DialogTop', 'top');
        //dialogStyle = replaceAll(dialogStyle, 'scroll', 'scrollbars');
               
        dialogStyle = 'modal=true,' + dialogStyle
        
        //if(dialogStyle.substring(dialogStyle.length - 1) == ",")
        //    dialogStyle = dialogStyle.substring(0, dialogStyle.length - 1)
        
        window.open(URL, 'newWin', dialogStyle);
        
        //window.showModalDialog(URL, Arguments, dialogStyle);
    } else 
        window.showModalDialog(URL, Arguments, dialogStyle);
}

function replaceAll(text, strA, strB)
{
    return text.replace( new RegExp(strA,"g"), strB );    
}

// ¶}±Ò·sµøµ¡ªº 
function MakeNewWindow(strUrl,intWidth,intHeight,isScor,strtarget,strtoolbar, strstatusbar,strresizable)
{
    var intLeft, intTop, objWnd;
	var ScorDesc="yes";
	if(intWidth == screen.width -18)
	{
	    intLeft = 0; 
	    intTop = 0;
	} else {    
        intLeft = (screen.width - intWidth) / 2;
        intTop = (screen.height - intHeight) / 2;
    }
    
    if (!isScor){
		ScorDesc="no"
    }
    if (strtarget == "")
		strtarget="_blank"
		
		
    objWnd = window.open(strUrl,strtarget," width = " + intWidth+",height = " + intHeight + ",resizable = " +strresizable+ ",status=" + "yes" +",scrollbars = " + ScorDesc + ",toolbar=" + strtoolbar); //strstatusbar
    objWnd.moveTo(intLeft,intTop);
    objWnd.focus();
}

function CloseWindow() {
    window.open("http://www.i-q.com.tw");
    window.opener=null;
    window.open('','_parent','');
    window.close();
}

function RedirectUrl(URL) {
    window.location.href = URL;
}